Skip site navigation (1) Skip section navigation (2)

Re: PQftype()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Naeslund\(f\)" <mag(at)fbab(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PQftype()
Date: 2001-04-30 22:11:54
Message-ID: 361.988668714@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"Magnus Naeslund\(f\)" <mag(at)fbab(dot)net> writes:
> Where do get a listing of what PQftype() can return to me?
>> 
>> select oid, typname from pg_type

> Does these change often?

The system type OIDs are stable.  User-defined types would probably have
a new OID after a dump and reload.

> Or could i do like the ODBC driver, autogenerate a .h out of that table.

I would not recommend relying on compiled-in OID knowledge for any types
other than the system-defined datatypes.  If you expect to have to deal
with user-defined types, it's best to cache the results of pg_type
lookups at the client end.  You need not worry about OIDs changing
during a single client connection.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Magnus Naeslund(f)Date: 2001-04-30 22:13:49
Subject: Re: PQftype()
Previous:From: Magnus Naeslund(f)Date: 2001-04-30 22:06:03
Subject: Re: PQftype()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group