OK, PostgreSQL 9.1 is just COOL!

PostgreSQL.jpg

OK, so I ran into what I thought was a bug in a user-defined PostgreSQL function regarding the holiday date for today. It's a Bank Holiday, but it's not a Market Holiday. I was able to prove this and fix it (temporarily) by changing the status of today's date:

  UPDATE calendar
  SET bank_holiday=TRUE
  WHERE calendar_date='2011-10-10';

and then the function I was counting on for telling me if today is a holiday started working.

So I knew the problem. But how to fix it? Well… it wasn't clear from the psql command-line how to do just that. I did a lot of googling to try and find out how to list functions, create functions, etc., and in the end, as luck would have it, PostgreSQL itself had the answer: \ef get_market_hours_for_date

The format is 'e' for edit, and 'f' for function, and then the name. If you just have the '\e', then it pops out into your EDITOR of choice for the last SQL command that was executed. If you give it the 'f' and a name, it'll pop you into your EDITOR and then let you edit the function.

Very nice!

These are the kinds of tools I'd expect from a commercial vendor, but I suppose, this is also what I'd want if I were working on PostgreSQL databases all day. I'm just really surprised and happy that these developers are thinking along the same lines. It's a great feeling to use such a fantastic database for my work - Mac and linux. It's nice to see the progress in time as well. It's really coming along.