Classes of returned rows

From: Jeff Waugh <jdub(at)aphid(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Classes of returned rows
Date: 2001-04-25 07:54:08
Message-ID: 20010425175408.I421@aphid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Is there a way of determining the original class of a row when querying
inherited tables? Consider:

CREATE TABLE users (
uid int4 SERIAL PRIMARY KEY,
email varchar(60)
);

CREATE TABLE clients (
surname varchar(30)
[etc]
) INHERITS (users);

CREATE TABLE suppliers (
surname varchar(30)
[etc]
) INHERITS (users);

Then, when I execute "SELECT * FROM users", I'd like to know which classes
each row belongs to, ie. suppliers, clients or users. Hopefully, as easy as
"SELECT oid, * FROM users" is!

I'm using 7.1 already, and it kicks arse. Many thanks to pgsql-hackers for a
wonderful piece of software I use every day. Thanks. :)

- Jeff

--
"Can we have a special TELSABUG category, and everything gets
dropped to fix them first?" - Telsa Gwynne

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley (UK) 2001-04-25 08:36:28 RE: IBM to buy Informix
Previous Message Bernyi Gbor 2001-04-25 07:32:07 Seral field value after INSERT !