What if you could turn
thousands of lines of code into
simple queries?

It so happens that a colleague of mine wanted to start using Emacs but couldn’t get to it. He insists on having proper color themes in all applications and some sensible defaults full of nifty add-ons everywhere, and didn’t want to have to learn that much about Emacs and Emacs Lisp to get started. I’m not even sure that he will Take the Emacs tour. You would tell me that there’s nothing we can do for so unfriendly users.


I wrote a book!


Yes, you read it well, el-get currently features 174 recipes, and is now reaching the 1.1 release. The reason for this release is mainly that I have two big chunks of code to review and the current code has been very stable for awhile. It seems better to do a release with the stable code that exists now before to shake it this much. If you’re wondering when to jump in the water and switch to using el-get, now is a pretty good time.


Dynamic Triggers in PLpgSQL

You certainly know that implementing dynamic triggers in PLpgSQL is impossible. But I had a very bad night, being up from as soon as 3:30 am today, so that when a developer asked me about reusing the same trigger function code from more than one table and for a dynamic column name, I didn’t remember about it being impossible. Here’s what happens in such cases, after a long time on the problem (yes, overall, that’s a slow day).


Hannu just gave me a good idea in this email on -hackers, proposing that pg_basebackup should get the xlog files again and again in a loop for the whole duration of the base backup. That’s now done in the aforementioned tool, whose options got a little more useful now: Usage: pg_basebackup.py [-v] [-f] [-j jobs] "dsn" dest Options: -h, --help show this help message and exit --version show version and quit -x, --pg_xlog backup the pg_xlog files -v, --verbose be verbose and about processing progress -d, --debug show debug information, including SQL queries -f, --force remove destination directory if it exists -j JOBS, --jobs=JOBS how many helper jobs to launch -D DELAY, --delay=DELAY pg_xlog subprocess loop delay, see -x -S, --slave auxilliary process --stdin get list of files to backup from stdin Yeah, as implementing the xlog idea required having some kind of parallelism, I built on it and the script now has a --jobs option for you to setup how many processes to launch in parallel, all fetching some base backup files in its own standard ( libpq) PostgreSQL connection, in compressed chunks of 8 MB (so that’s not 8 MB chunks sent over).


After reading Simon’s blog post, I can’t help but try to give some details about what it is exactly that I’m working on. As he said, there are several aspects to extensions in PostgreSQL, it all begins here: Chapter 35. Extending SQL. It’s possible, and mostly simple enough, to add your own code or behavior to PostgreSQL, so that it will use your code and your semantics while solving user queries.

Dimitri Fontaine

PostgreSQL Major Contributor

Open Source Software Engineer

France