On Tue, 30 May 2006, Stephen Gran wrote: > > Indeed, that's what I meant... the difference is that the postinst would > > add plpgsql support to the "template1" database whereas sqlledger could > > add the language support only to the database which really need it. > > I meant the postinst could add it only to the sql-ledger database. I am > not sure we should add that language to the whole database, as there may > be some reason I am not thinking of for not wanting it everywhere.
There's no "sql-ledger" database created at installation time. The database is created by sql-ledger itself. The README.Debian currently mentions awful recommendations (giving www-data the right to create DB)... however it warns the user that is bad security-wise and that they should setup a more elaborate posqtgresql auth scheme. And BTW, sql-ledger can be used to handle the accounting of several companies on the same server, so sql-ledger may have to handle several databases. > > It's not a big deal IMO. The next question is the following: how do we > > reliably check if the language is already installed or not? > > SELECT * FROM pg_catalog.pg_language WHERE lanname = 'plpgsql'; > > That being said, I am not sure how easy that's going to be from a > postinst. > > I guess something like > echo "SELECT * FROM pg_catalog.pg_language WHERE lanname = 'plpgsql';" | psql > -U $user .... > > might work, although it's not very clever. Indeed. I knew that I could do with an SQL request but I really wish I had an official interface from Postgresql. I don't have time to look right now but maybe createlang is clever enough and doesn't fail if the language is already created? Cheers, -- Raphaël Hertzog Premier livre français sur Debian GNU/Linux : http://www.ouaza.com/livre/admin-debian/

