Re: Getting oid with libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jtv(at)xs4all(dot)nl
Cc: "Johan C(dot) de Koning" <johan(dot)de(dot)koning(at)geodan(dot)nl>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Getting oid with libpq
Date: 2005-08-11 13:57:24
Message-ID: 21817.1123768644@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

jtv(at)xs4all(dot)nl writes:
> const char *OldLocale = setlocale(LC_NUMERIC, "C");
> Then run the pointer returned by PQgetValue() through atol() to get a
> numeric value, and finally restore the previous locale with
> setlocale(LC_NUMERIC, OldLocale);

Uh ... there is nothing at all locale-sensitive about atol, nor strtoul
which is what you really want to use for an OID.

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Johan C. de Koning 2005-08-11 14:08:31 Re: Getting oid with libpq
Previous Message jtv 2005-08-11 07:06:37 Re: Getting oid with libpq