Subject: questions

From: [email-masked]
Date: Thu, 11 Jul 91 10:08:20 -0700

1.  Given a tuple, can its class (relation) be determined?
2.  What's the difference between object id and tuple id?
3.  Is there a way to print out the definition of a previously defined
    relation?

-- tung

---

From: [email-masked] (Mike Olson)
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

    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
					[email-masked]