Re: Feedback on writing extensible modules - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Feedback on writing extensible modules
Date
Msg-id 27574.1243786890@sss.pgh.pa.us
Whole thread Raw
In response to Re: Feedback on writing extensible modules  (Dimitri Fontaine <dfontaine@hi-media.com>)
Responses Re: Feedback on writing extensible modules
Re: Feedback on writing extensible modules
List pgsql-hackers
Dimitri Fontaine <dfontaine@hi-media.com> writes:
> Dimitri Fontaine <dfontaine@hi-media.com> writes:
>> And currently calling SPI_connect() from _PG_init will crash the
>> backend. I'll try to obtain a gdb backtrace, I've just been told about
>> pre_auth_delay and post_auth_delay parameters.

> Here we go:

The reason this doesn't work is that SPI can only be invoked inside a
transaction, and you're not inside one when a library is being
preloaded.

> I'm very interrested in being able
> to prepare a query at local_preload_libraries time, if possible in 8.3
> and following releases.

You could maybe make this work by executing your own transaction
to do it, but I really have to wonder if it's a good idea.  One
point to think about is that elog(ERROR) still means elog(FATAL)
at this point, so any brokenness in the queries you're trying to
prepare will result in locking all users out of the database.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: information_schema.columns changes needed for OLEDB
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #4822: xmlattributes encodes '&' twice