Return-Path: postman 
Delivery-Date: Mon, 23 Aug 93 05:08:13 PDT
Return-Path: postman
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA28900; Mon, 23 Aug 93 05:00:54 -0700
Resent-From: postman (POSTGRES mailing list)
Resent-Message-Id: <9308231200.AA28900@postgres.Berkeley.EDU>
Return-Path: owner-postman@postgres.Berkeley.EDU
Sender: owner-postman@postgres.Berkeley.EDU
Return-Path: turk@andrews.edu
Received: from peter.cs.andrews.edu by postgres.Berkeley.EDU (5.61/1.29)
	id AA28891; Mon, 23 Aug 93 05:00:47 -0700
Received: by andrews.edu (5.57/Ultrix3.0-C)
	id AA01108; Mon, 23 Aug 93 08:10:02 -0400
From: turk@andrews.edu (Daniel Turk)
Message-Id: <9308231210.AA01108@andrews.edu>
Subject: Re: Postgres data types
To: postgres@postgres.berkeley.edu
Date: Mon, 23 Aug 1993 08:09:32 -0400 (EDT)
X-Mailer: ELM [version 2.4 PL21]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 1575      
Resent-To: postgres-dist
Resent-Date: Mon, 23 Aug 93 05:00:53 PDT

> > Hi!  I'm wanting to know how to determine Postgres class field types
> > from within a C program.  I am able to find out class names and all the
> > field names within a given class.  But I'm not sure how to find out what
> > data type each field is specified as.  Can this be done easily?  How?
> > 
> > --------------------------------------------------------------------------
> > Dan Turk     Computer Science & Information Systems     Andrews University
> > Berrien Springs, MI          turk@andrews.edu               (616) 471-3426
> > ==========================================================================
> > 
> 
> 
> Hi Dan,
> 
> i think that should be possible by browsing through the POSTGRES catalogs
> pg_relation and pg_attribute. If you read all tuples from pg_attribute
> where attrelid equals the oid of your class then the attributes attname 
> and atttypid should tell you what you want.
> That's just how i would try to solve your problem. I don't know if it
> works but i can't see why not.
> 
> Bye Wolf

Yes, that's what I'd think too.  Except that the atttypid is just an
integer and I don't know how it maps to logical data types.....  I would
think that this information would be part of Postgres and that I could
access it internally.....

--------------------------------------------------------------------------
Dan Turk     Computer Science & Information Systems     Andrews University
Berrien Springs, MI          turk@andrews.edu               (616) 471-3426
==========================================================================
