This one time, at band camp, Raphael Hertzog said:
> On Tue, 30 May 2006, Stephen Gran wrote:
> > This one time, at band camp, Raphael Hertzog said:
> > > This bug report is a user mistake and not a bug of the package. However I
> > > acknowledge that the package should be more user-friendly and it should
> > > automatically add support of plpgsql to any available postgresql in its
> > > postinst script.
> > > 
> > > The "nice" solution would be for sql-ledger to automatically add plpgsql
> > > support on the sql-ledger database only but I don't think that this is
> > > possible since sql-ledger runs as www-data.
> > 
> > But the postinst doesn't.  It should certainly be able to add plpgsql
> > support.  Perhaps this is the right way forward?
> 
> 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.

> 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.
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

Reply via email to