Re: libpq lo_open errors when first action in connection
| От | Alvaro Herrera |
|---|---|
| Тема | Re: libpq lo_open errors when first action in connection |
| Дата | |
| Msg-id | 20050513031646.GB28148@surnet.cl обсуждение исходный текст |
| Ответ на | libpq lo_open errors when first action in connection ("Greg Sabino Mullane" <greg@turnstep.com>) |
| Ответы |
Re: libpq lo_open errors when first action in connection
|
| Список | pgsql-hackers |
On Fri, May 13, 2005 at 02:39:25AM -0000, Greg Sabino Mullane wrote: > I'm having some problems with lo_open inside of DBD::Pg (which > uses libpq) and need help in debugging the problem. The problem > is that a call to lo_open works perfectly, *unless* it is the > first thing that this connection to the database has done, in > which case it returns a -1 (which comes back to perl as undef). > To be more specific, I need to issue a "SELECT 123;" (or anything > else via PQexec) before the call will succeeed. All the parameters > to lo_open look normal and identical whether PQexec has been called > or not, and lo_creat always works just fine. It has to be PQexec*, > a prepare alone will not do the trick. The problem is that LO descriptors are only valid for the duration of the transaction. So your "select 123" opens a transaction, and autocommit = 0 makes it not close until after the function is called. If you don't send the query first, both function calls happen in different transactions. I think you should make the func() method open a transaction, just like a query does. -- Alvaro Herrera (<alvherre[a]surnet.cl>) La web junta la gente porque no importa que clase de mutante sexual seas, tienes millones de posibles parejas. Pon "buscar gente que tengan sexo con ciervos incendiándose", y el computador dirá "especifique el tipo de ciervo" (Jason Alexander)
В списке pgsql-hackers по дате отправления: