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                 

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to