Re: Array question

"David E. Wheeler" <[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
On Sep 8, 2009, at 9:10 AM, Andrew Dunstan wrote:

> The protocol doesn't know anything about arrays or composites,  
> AFAIK. If it passes the type oid, it will be the oid of the array or  
> composite type, but the receiver has no way in the protocol of  
> knowing that the type is such an animal. Of course, it is possible  
> to look that up in the catalog (see pg_type columns typtype, typelem  
> and typarray). But, as I pointed out above, none of that helps you  
> determine the info for a type that is user-defined in C.

This explains why the values are hard-coded: we can just identify the  
OIDs. And since hstore and citext are contrib modules, their OIDs are  
not known ahead of time (PostgreSQL does not hard-code them), so one  
would *have* to look them up. :-(

At the very least, we need to find a way to let users tell DBD::Pg how  
to handle certain types. DBD::Pg could then look up the appropriate  
OIDs when it first connects and then store them.

Thoughts?

Best,

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.