'Lite' Databases (Re: sqlite3 and dates)

Chris Angelico rosuav at gmail.com
Thu Feb 19 02:23:26 EST 2015


On Thu, Feb 19, 2015 at 6:07 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Very possibly. With modern dependency management, it isn't hard to install
> Postgresql:
>
> sudo aptitude postgresql
>
> or equivalent should work. For primitive operating systems with no
> dependency management available, Firefox could come with a simple script
> which downloads, installs, configures and runs Postgresql. (Everything is
> simple for the guy who doesn't have to do it.)

Definitely a possibility. I'm pretty sure I've seen that exact thing
done by one application (on Windows; on a typical Linux system,
that'll be done by simple dependency management - your package
metadata says "depends on postgresql" and apt-get or yum or whatever
will do the work), and it's quite common for a Windows installer
wizard to go through a series of subcomponents (grab the .NET
framework, grab these hotfixes that the program depends on, grab some
adware toolbar that you forgot to untick, and *then* install the
program you asked for).

> Possible snags:
>
> - Possibly postgresql is simply *too big*. Your 50MB(?) Firefox
>   turns into a 2GB install. I doubt it -- on Debian, postgresql
>   is 17MB installed. But I don't know what dependencies I'm not
>   counting.

Yeah. And frankly, I would be surprised if Firefox is only 50MB these
days. The extra dent of PostgreSQL won't be all that significant - and
don't forget that the SQLite3 dent can be removed, so you're talking
about the difference between them, plus you can omit a whole bunch of
PG's ancillaries.

> - Or it is impossible to configure without excessive amounts of
>   tech-savvy human intervention. Again, I doubt it. I seem to
>   recall needing to create a Postgresql user and password. But
>   maybe even that is too technical for the average Firefox user.

You don't even need to do that. An absolutely default Postgres on
Debian or Ubuntu is ready to use, with peer authentication. If you can
become root, you can then drop privs to the 'postgres' user and
connect to the database that way.

I don't know if it's possible to do a non-root installation of
PostgreSQL, but if it isn't today, it could easily be tomorrow, if
someone puts in a little effort. You'd miss out on boot-time startup,
and it'd probably have to do some password-based authentication (with
autogenerated passwords), but it certainly could work. The Windows
equivalent ("install for just me") is, I think, already possible.

> - Maybe there are nasty interactions between Postgresql listening
>   on some port and Windows firewall wanting to block that same port.

That's definitely an issue, given that Windows doesn't have Unix
domain sockets. But I'm sure it's a solvable problem. How does IDLE
cope with firewall issues?

ChrisA



More information about the Python-list mailing list