pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Type OIDs
Date: Sat, 06 Jun 2009 12:32:07 +0200
Message-ID: <87r5xxwt3s.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <10172.1244057188@sss.pgh.pa.us>
References: <877hztupfn.fsf@mid.deneb.enyo.de>
	<10172.1244057188@sss.pgh.pa.us>

* Tom Lane:

> Florian Weimer <fw@deneb.enyo.de> 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.

Okay, will do that. Thanks.

By the way, the binary encoding would be pretty useful for BYTEA
columns and parameters, but it's a pretty hefty burden for almost
anything else.  Wouldn't it make sense to add a format flag which
basically says "binary if it's BYTEA, otherwise text"?  I don't think
many host languages make a strong distinction between BYTEA and TEXT
types (except those which use UTF-16 and expose that to the user, like
Java and C#).  As a result, it is difficult to specify the right types
when talking to the server.  You don't want to label a column as BYTEA
overeagerly because it will break type inference on the SQL side (I
think).



view thread (6+ messages)  latest in thread

Message-ID: <87r5xxwt3s.fsf@mid.deneb.enyo.de>
Permalink:  ../87r5xxwt3s.fsf@mid.deneb.enyo.de/
Also on:    postgresql.org/message-id/87r5xxwt3s.fsf@mid.deneb.enyo.de

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: fw@deneb.enyo.de, tgl@sss.pgh.pa.us
  Subject: Re: Type OIDs
  In-Reply-To: <87r5xxwt3s.fsf@mid.deneb.enyo.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox