Re: [GENERAL] Basic questions about PQprepare()

2006-01-31 Thread Tom Lane
Keary Suska <[EMAIL PROTECTED]> writes: > This thread has particular interest to me as well--the libpq documentation > and examples seem to imply that the backend will consider all parameters to > be string literals, although postgres is smart enough to perform > conversions. No, not a "string lit

Re: [GENERAL] Basic questions about PQprepare()

2006-01-31 Thread Keary Suska
on 1/29/06 8:00 PM, [EMAIL PROTECTED] purportedly said: > On Sun, Jan 29, 2006 at 06:03:41PM +0100, Joachim Wieland wrote: >> On Sat, Jan 28, 2006 at 08:26:01PM +0100, Alexander Farber wrote: >>> Could you explain a bit more, where to get the OIDs? >> >> They are in the pg_type table, it is descr

Re: [GENERAL] Basic questions about PQprepare()

2006-01-29 Thread Michael Fuhr
On Sun, Jan 29, 2006 at 06:03:41PM +0100, Joachim Wieland wrote: > On Sat, Jan 28, 2006 at 08:26:01PM +0100, Alexander Farber wrote: > > Could you explain a bit more, where to get the OIDs? > > They are in the pg_type table, it is described here: > > http://www.postgresql.org/docs/8.1/static/cata

Re: [GENERAL] Basic questions about PQprepare()

2006-01-29 Thread Joachim Wieland
Alexander, On Sat, Jan 28, 2006 at 08:26:01PM +0100, Alexander Farber wrote: > Could you explain a bit more, where to get the OIDs? They are in the pg_type table, it is described here: http://www.postgresql.org/docs/8.1/static/catalog-pg-type.html You can select it like any other table: select

Re: [GENERAL] Basic questions about PQprepare()

2006-01-28 Thread Alexander Farber
Thank you Tom, I also should have reread the docs on 1) and 2) - it is mentioned there too that you have to call PQfinish and PQclear even on failed operations. Could you explain a bit more, where to get the OIDs? There are really not many PQprepare examples around (I wonder why, isn't it the fas

Re: [GENERAL] Basic questions about PQprepare()

2006-01-28 Thread Tom Lane
Alexander Farber <[EMAIL PROTECTED]> writes: > 1) If PQconnectdb fails, do I still need to PQfinish the returned pointer? Yes, if you don't want to leak memory. > 2) Similar, if PQprepare fails, do I still need to PQclear its result? Yes, if you don't want to leak memory. > 3) Do I have to PQcl

[GENERAL] Basic questions about PQprepare()

2006-01-27 Thread Alexander Farber
Hello, I'm trying to write an Apache 1.3.29 module connecting to PostgreSQL 8.1.0 on OpenBSD -current and have few probably simple questions: When an Apache child is initialized, I'd like to establish connection to the database and to prepare 2 queries. And then later in the repeating response ph