Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00911; Mon, 15 Jul 91 13:10:39 -0700
Message-Id: <9107152010.AA00911@postgres.Berkeley.EDU>
From: mao@postgres.Berkeley.EDU (Mike Olson)
Subject: Re: questions
To: postgres@postgres.berkeley.edu
In-Reply-To: Your message of "Thu, 11 Jul 91 10:08:20 PST."
             <9107111708.AA12372@postgres.Berkeley.EDU> 
Date: Mon, 15 Jul 91 13:02:49 PDT

> 1.  Given a tuple, can its class (relation) be determined?

no.

> 2.  What's the difference between object id and tuple id?

an OID is a guaranteed-unique four-byte identifier.  a tid is guaranteed
to be unique only within a given relation; it's actually a <block,page,offset>
triple that tells us where the tuple is in the file that stores the
relation.  tids are not especially useful outside the postgres backend.

> 3.  Is there a way to print out the definition of a previously defined
>     relation?

    retrieve (r.relname, a.attname, t.typname) from r in pg_class,
	    a in pg_attribute, t in pg_type
	    where r.relname = "myrel"
		  and a.attrelid = r.oid
		  and a.atttypid = t.oid

will give you the schema for relation "myrel".

					mike olson
					postgres research group
					uc berkeley
					mao@postgres.berkeley.edu
