Classes of returned rows - Mailing list pgsql-general

From Jeff Waugh
Subject Classes of returned rows
Date
Msg-id 20010425175408.I421@aphid.net
Whole thread Raw
Responses Re: Classes of returned rows
Re: Classes of returned rows
List 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

pgsql-general by date:

Previous
From: Theo van der Sluijs
Date:
Subject: state locked row (PLEASE HELP ME)
Next
From: "Wendy"
Date:
Subject: Why Size Of Data Backed Up Varies Significantly In SQL 6.5?