Re: PG_DIAG_STATEMENT_POSITION Where is it defined? - Mailing list pgsql-general

From Tony Caduto
Subject Re: PG_DIAG_STATEMENT_POSITION Where is it defined?
Date
Msg-id 446B8E6D.3080102@amsoftwaredesign.com
Whole thread Raw
In response to Re: PG_DIAG_STATEMENT_POSITION Where is it defined?  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Responses Re: PG_DIAG_STATEMENT_POSITION Where is it defined?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Tony Caduto wrote:
> Martijn van Oosterhout wrote:
>> src/include/postgres_ext.h
>>
>>
> I did  use grep but I am confused by what it showed,
>
> according to the docs:
> http://www.postgresql.org/docs/8.1/static/libpq-exec.html
> it should be a integer not 'P'
>
> Those symbols are used by PQresultErrorField which expects a integer
> value.
>
> Thanks,
>
I got it working, in Pascal you have to pass P as ord('P')

PQresultErrorField(fstatement,ord('P'));

It's one of those cryptic ways you can use a char as a integer in C :-)

--
Tony


pgsql-general by date:

Previous
From: Tony Caduto
Date:
Subject: Re: PG_DIAG_STATEMENT_POSITION Where is it defined?
Next
From: Emi Lu
Date:
Subject: Add column and specify the column position in a table