News for hackers. Stuff that matters.
Re:Installing and Using PostgreSQL Modules by jeltz on Tuesday July 03, 2012 @03:46AM (#4192996)
In PostgreSQL 9.1 the contrib modules were all converted to the new concept of extensions. So instead of having to run a SQL script you can simply run.

CREATE EXTENSION hstore;

The advantages of this new command is that extensions can easily be uninstalled, installed in other schemas, and most of the problems with modules relating to database upgrades are gone.

Re:Installing and Using PostgreSQL Modules by mgkimsal on Tuesday July 03, 2012 @06:47AM (#4193457)
pgnoob here: wouldn't "install extension" have been more accurate? It's probably doing something 'create'-ive under the hood, but to install something with 'create' doesn't seem at all intuitive. If this was something legacy from 30 years ago, I'd understand changing at this point doesn't make much sense, but this seems recent.
Re:Installing and Using PostgreSQL Modules by jeltz on Tuesday July 03, 2012 @07:00AM (#4193493)
I believe it was for symmetry with already existing CREATE commands. Especially CREATE LANGUAGE comes to mind. CREATE LANGUAGE is very similar in that what is does is installing a stored procedure programming language into the current database.

Another advantage of using CREATE is that it is an already existing convention in PostgreSQL which means it is obvious that there may be an ALTER EXTENSION and a DROP EXTENSION (both exist). If they had called it INSTALL then it could be either UNINSTALL EXTENSION or REMOVE EXTENSION.

In summary: It is meant to be intuitive to people who are used to SQL databases.

EDIT: And yes, it does "'create'-ive" under the hood. I.e. the various CREATE commands generally insert new rows in the catalog tables (the tables that store the schema definitions and users). pg_extension is the catalog table containing the list of installed extension.

Re:Installing and Using PostgreSQL Modules by mgkimsal on Tuesday July 03, 2012 @08:15AM (#4193694)
Thanks for the explanation.