logo       

Re: DataType OID for PQexecParams-call in libpq: msg#00006

Subject: Re: DataType OID for PQexecParams-call in libpq

Tom Lane writes:
>>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

The pg_type.h file has all sorts of other stuff in it - so including it while coding a client I makes a mess - I would like to have access to the "standard" values (especially since OID's are used in the libpq C interface for select).  So, the select statement "select oid from pg_type where typename=.." can't be processed because you need to know the oid of the value coming back from that select statement (never ending loop!).  I would love to see something like pg_oid_type.h that is something like this..

enum OID_TYPES
{
  BOOLOID=16,
  BYTEAOID=17,
  CHAROID=18,
...
}
so that its easy to get the value of a specific oid, but you can also type cast easily (or have an array of the OID_TYPES).  I know this doesn't handle the user defined types, but I think it would be very helpfull (or some defines for the pg_type.h file so that we can get just the oids, and not everything else for a client).

My 2 cents
Mark



********************************************************************************
This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please erase all copies of the
message and its attachments and notify Space Imaging immediately.
********************************************************************************
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe