Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

Next:From: Johan C. de KoningDate: 2005-08-11 14:08:31
Subject: Re: Getting oid with libpq
Previous:From: jtvDate: 2005-08-11 07:06:37
Subject: Re: Getting oid with libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group