X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 80D9552B31 for ; Thu, 11 Aug 2005 11:09:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69668-02 for ; Thu, 11 Aug 2005 14:09:07 +0000 (GMT) Received: from mailbin.geodan.nl (unknown [194.109.122.3]) by svr1.postgresql.org (Postfix) with ESMTP id 1C7B552869 for ; Thu, 11 Aug 2005 11:09:05 -0300 (ADT) Received: from flaptop ([192.168.25.184]) by geodan.nl (geodan.nl [194.109.122.3]) (MDaemon.PRO.v8.1.1.R) with ESMTP id md50001468307.msg for ; Thu, 11 Aug 2005 16:09:03 +0200 From: "Johan C. de Koning" To: "'Tom Lane'" , Cc: Subject: Re: Getting oid with libpq Date: Thu, 11 Aug 2005 16:08:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <21817.1123768644@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcWefLY1vz1sLwnWTJidnswogqjx3AAATtoA X-Spam-Processed: geodan.nl, Thu, 11 Aug 2005 16:09:03 +0200 (not processed: message from valid local sender) X-MDRemoteIP: 192.168.25.184 X-Return-Path: johan.de.koning@geodan.nl X-MDaemon-Deliver-To: pgsql-interfaces@postgresql.org Message-Id: <20050811140905.1C7B552869@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.193 tagged_above=0 required=5 tests=[AWL=-0.561, FORGED_RCVD_HELO=0.05, MSGID_FROM_MTA_ID=1.704] X-Spam-Level: * X-Archive-Number: 200508/21 X-Sequence-Number: 5692 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