Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CECF6633A74 for ; Wed, 3 Jun 2009 23:18:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29772-10 for ; Wed, 3 Jun 2009 23:18:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from joeconway.com (wsip-72-214-29-243.sd.sd.cox.net [72.214.29.243]) by mail.postgresql.org (Postfix) with ESMTP id B4F1B633660 for ; Wed, 3 Jun 2009 23:18:23 -0300 (ADT) Received: from [192.168.4.40] (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 7897077; Wed, 03 Jun 2009 18:18:22 -0700 Message-ID: <4A2720DE.6070003@joeconway.com> Date: Wed, 03 Jun 2009 18:18:22 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.5.0.12-3.fc6 pango-text Thunderbird/1.5.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Tom Lane CC: Florian Weimer , pgsql-interfaces@postgresql.org Subject: Re: Type OIDs References: <877hztupfn.fsf@mid.deneb.enyo.de> <10172.1244057188@sss.pgh.pa.us> In-Reply-To: <10172.1244057188@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200906/3 X-Sequence-Number: 6871 Tom Lane wrote: > Florian Weimer writes: >> Can I embed the types I'm interested in into my program, or should I >> query the server at least once per connection to get the mapping? I'm >> interested in types such as INTEGER, TEXT, BYTEA, etc. No user >> defined types, and nothing fancy. Ultra-long-term portability isn't >> required, either. > > Well, the type OIDs of the standard built-in types haven't changed in > at least ten years, but that doesn't mean we won't change 'em in the > future. I'd advise at least using the #define's from pg_type.h rather > than writing actual numeric constants. I'll second that. It's exactly what I've been doing in PL/R for several years now. Joe