Re: libpq Describe Extension [WAS: Bytea and perl] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq Describe Extension [WAS: Bytea and perl]
Date
Msg-id 9374.1150503681@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq Describe Extension [WAS: Bytea and perl]  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: libpq Describe Extension [WAS: Bytea and perl]  (Volkan YAZICI <yazicivo@ttnet.net.tr>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Volkan YAZICI wrote:
>> The problem is, AFAICS, it's not possible to distinguish between a tuple
>> returning query (T, ..., C, Z or T, E) and a description of a portal (T,
>> Z). Therefore, I've created a global flag (parsing_row_desc) which is
>> turned on when we receive a 'T' and turned off if we receive a 'C' or
>> 'E'. It's a kind of ugly method but the only solution I could come up
>> with.

> The problem with this solution is that it is not thread-safe.  Perhaps
> you can use a per-PGconn boolean?

The whole thing sounds like brute force to me.  Shouldn't you be adding
states to enum PGQueryClass, if you need to track what sort of Describe
you're doing?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: MultiXacts & WAL
Next
From: Tom Lane
Date:
Subject: Curious bug in buildfarm files-changed links