Re: Getting oid with libpq
| От | Johan C. de Koning |
|---|---|
| Тема | Re: Getting oid with libpq |
| Дата | |
| Msg-id | 20050811140905.1C7B552869@svr1.postgresql.org обсуждение исходный текст |
| Ответ на | Re: Getting oid with libpq (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Getting oid with libpq
|
| Список | pgsql-interfaces |
I tried to use atol but i get always 0 as result. Is this because I use a
binary cursor to select the data (there are some PostGIS datatypes inside my
resultset which are binary data).
Best regards,
Johan de Koning
-----Oorspronkelijk bericht-----
Van: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Verzonden: donderdag 11 augustus 2005 15:57
Aan: jtv@xs4all.nl
CC: Johan C. de Koning; pgsql-interfaces@postgresql.org
Onderwerp: Re: [INTERFACES] Getting oid with libpq
jtv@xs4all.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
В списке pgsql-interfaces по дате отправления: