Dimitri Fontaine <dfonta...@hi-media.com> writes: > Dimitri Fontaine <dfonta...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers