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

Re: DataType OID for PQexecParams-call in libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gergely Czuczy <phoemix(at)harmless(dot)hu>
Cc: Jan Klostermann <klostermann(at)rhf(dot)de>,pgsql-interfaces(at)postgresql(dot)org
Subject: Re: DataType OID for PQexecParams-call in libpq
Date: 2004-03-16 15:40:52
Message-ID: 24982.1079451652@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Gergely Czuczy <phoemix(at)harmless(dot)hu> writes:
> please take a look at the documentation at
> http://www.postgresql.org/docs/7.4/static/libpq-exec.html
> at the point "PQftype", where it's said:
> " The OIDs of the built-in data types are defined in the file
> src/include/catalog/pg_type.h in the source tree."

Also, you can get the OID on the fly, eg with
	SELECT oid FROM pg_type WHERE typname = ...
For standard built-in types it's okay to hard-wire OID values into your
code, but if you want to be able to deal with user-defined types you
shouldn't rely on the OID being constant.

			regards, tom lane

In response to

pgsql-interfaces by date

Next:From: Cal McPhersonDate: 2004-03-17 00:29:10
Subject: inserting time_t into timestamp field(C language)
Previous:From: Gergely CzuczyDate: 2004-03-16 13:36:45
Subject: Re: DataType OID for PQexecParams-call in libpq

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