Received: from druid.net (root@druid.net [198.96.119.226]) by hub.org (8.8.8/8.8.8) with SMTP id WAA14757 for ; Thu, 1 Oct 1998 22:14:27 -0400 (EDT) (envelope-from darcy@druid.net) Received: from localhost (1552 bytes) by druid.net via sendmail with P:stdio/R:inet_hosts/T:smtp (sender: ) (ident using unix) id for ; Thu, 1 Oct 1998 22:14:24 -0400 (EDT) (Smail-3.2.0.101 1997-Dec-17 #1 built 1998-Jul-20) Message-Id: From: darcy@druid.net (D'Arcy J.M. Cain) Subject: Re: [SQL] Getting datatype before SELECT To: glenn.sullivan@nmr.varian.com (Glenn Sullivan) Date: Thu, 1 Oct 1998 22:14:24 -0400 (EDT) Cc: herouth@oumail.openu.ac.il (herouth maoz), pgsql-sql@hub.org In-Reply-To: <3613BE6D.215C6663@nmr.varian.com> from "Glenn Sullivan" at Oct 01, 1998 11:39:57 AM X-Mailer: ELM [version 2.5 PL0b1] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thus spake Glenn Sullivan > The value I get returned from PQftype() for a varchar is 1043 > and for an int is 23. > I am uncomfortable just testing for these values. I could > not find in the documentation, what the return values of > PQftype() are. Can anyone point me to that information? Here's a Python script to generate #defines for a C header. I'm sure you can figure out how to convert it for your needs. #! /usr/local/bin/python import string # change this if you have it somewhere else for l in open("/usr/local/pgsql/src/include/catalog/pg_type.h").readlines(): tokens = string.split(l) if len(tokens) == 0 or tokens[0] != "#define": continue if tokens[1] in ('CASHOID', 'INT2OID', 'INT4OID', 'OIDOID', 'FLOAT4OID', 'FLOAT8OID'): print l, -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.