Re: libpq Describe Extension [WAS: Bytea and perl]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: libpq Describe Extension [WAS: Bytea and perl]
Date: 2006-08-16 17:14:57
Message-ID: 26786.1155748497@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice

Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> On Aug 16 11:37, Tom Lane wrote:
>> I think this viewpoint has pretty much carried the day, so the
>> PQdescribe functions should remain separate. However, it still seems
>> to me that it'd be a shame if PQdescribePrepared couldn't return the
>> statement's output column types, seeing that the backend is going to
>> pass that info to us anyway.

> I think you have a misunderstanding about the patch I previously sent.
> When you issue a PQdescribePrepared() call, in the first PQgetResult()
> call returned PGresult will have the input parameter types of the
> prepared statement. And in the second PQgetResult() call, returned
> PGresult will hold statement's output column types.

[ raised eyebrow... ] You're right, I didn't understand that, and now
that I do I find it completely unacceptable. We need exactly one
PGresult per operation, or things just get too weird for clients to
manage, particularly when considering async behavior. What you suggest
is a *huge* violation of the principle of least surprise. Adding a
couple more PGresult accessor functions seems far saner.

> Another possibility can be like this:

> PGresult *PQdescribePrepared(PGconn *conn,
> const char *stmt,
> Oid **argtypes);

No, because that doesn't work at all for the async case.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2006-08-16 17:17:18 Re: Enum proposal / design
Previous Message Jim C. Nasby 2006-08-16 17:13:08 Re: BugTracker (Was: Re: 8.2 features status)

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-08-16 17:38:41 Re: [NOVICE] DB insert Error
Previous Message Volkan YAZICI 2006-08-16 17:04:07 Re: libpq Describe Extension [WAS: Bytea and perl]