Tag Archives: Postgres

A slight return to Postgres

Years ago, I used to set up postgres on Debian servers. For a couple of test, I had to install Postgres somewhere: Installing on Windows is generally a breeze, but not needing the third-party tools, I decided to go back to Linux and install the database server on my Ubuntu box. While I didn’t have issues with importing test data/databases, there were minor things that had me briefly stumped. So, to install Postgres on Ubuntu and other Debian flavours, here we go:

  1. First install postgres by entering ‘apt-get install postgresql’ in a bash-session/terminal
  2. We need to properly initialize it and I would recommend to add your login user to Postgres: sudo -u postgres createuser -D -P arthur
  3. Optionally, create a new database: sudo -u postgres createdatabase -O username whateveryouhavefordatabasename
  4. Open up pg_hba.cfg (sudo vi /etc/postgresql/9.1/main/pg_hba.conf).
  5. Change the following lines properly (use trust):
    # IPv4 local connections:
    host all all trust
    host all all trust

  6. Open up postgresql.conf and set listen_addresses = ‘*’ properly (* means that postgres will listen to all ip-address as defined in networking)
  7. Restart postgresql
  8. Connect to postgres using the psql client: psql -U arthur -h localhost -d whichever database

The official postgres site has demo databases (or rather links to them): they are around this url

Oh, yeah

There’s this excellent BBC documentary about Titan (the moon) and Huygens (you may remember the successful Huygens touchdown). If you’re a movie aficionado, pay attention to the music that accompanies many scenes. You may recognize some of them.

There’s a myth out there that you can’t run Disk Defrag and MediaPlayer at the same time. Or that you need at least 2 Gig to have MediaPlayer play smoothly. This is bullocks.

National Geographic has a great article about malaria and mosquitoes (more on malaria at the WHO).

I’m not sure if this one fits in this posting, but, remarkably, a couple of developers announced Sylph-Searcher, a program that promises fast searching through (Sylpheed) MH folders. Wait: the announcement was made in the Postgres developers mailing-list. Apparently, you can use a database to store all your important e-mails from within Sylpheed. This makes perfectly sense: I mean, do you remember your very first e-mail? 100 to 1 that you don’t have that one anymore and that you wished you saved it somewhere safely into a database.


Last week, I read about the Canadian Tax problems, which forced the Revenue centre to shutdown operations because of ‘inconsistent’ data. I hear that they expect to be up and running starting next Thursday. Earlier, via the Postgres mailing-list, I read that the problems were more in the ‘design’ of some of the internal tables, which (of course) started a whole discussion about the lack of professionalism in the industry:

CRA spokesperson Jacqueline Couture said the problem resulted in scrambled information in electronic tax returns. For instance, in some cases the field for the social insurance number was instead filled in with a birth date (ed. What, you mean, these weren’t strongly typed fields?)

If your stomach can bear it, the postgres thread follows right here.

Alfons reminded me of XSLT, which is an XML language used for transformations. XSLT comes in handy when you have to convert from one XML format to another. Obviously, his choice of flavour nowadays is XML and (good for you), C# comes with good XSLT support too. Earlier last year, I was looking into the XBRL standard.

I also found out that Berkely DB has been a part of Oracle (since when?). Better yet, Oracle released the Berkeley DB XML as open source too. It’s a good 52 MB download.

On the flipside, recently, I have played with SQLite, which is a highly portable (multi-platform) embedded database engine. It’s so good, that it has been thrown in the Public Domain. And yes, apparently, the designer was heavily inspired by Postgres.