Chained table entries

From: "Roderick A(dot) Anderson" <raanders(at)altoplanos(dot)net>
To: "PostgreSQL::General List" <pgsql-general(at)postgreSQL(dot)org>
Subject: Chained table entries
Date: 2000-10-30 23:25:28
Message-ID: Pine.LNX.4.10.10010301513090.4776-100000@altoplanos.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Or maybe some other thingy.

I have a table that I want to refer to one of it's own attributes. I
thought of RI but there has to be a top level entry that shouldn't be in
the table. Then I thought of a check constraint using a select with
UNION but that dies (probably because UNIONs in views aren't ready for
primetime yet). So finally I figured a RULE would work but I've never
done one and am waiting on Bruce's book before trying.
But I'm not above accepting suggestions - or code.

The table has a primary key attribute whos values could be used in another
column or have a VALUE of 'NEWthingy'.

If I could do the RI as a view the code would be

create view THINGYS
as select tbl_key
from maintable
UNION select 'NEWthingy'
;

Will a Rule handle this?

TIA,
Rod
--
Roderick A. Anderson
raanders(at)altoplanos(dot)net Altoplanos Information Systems, Inc.
Voice: 208.765.6149 212 S. 11th Street, Suite 5
FAX: 208.664.5299 Coeur d'Alene, ID 83814

Browse pgsql-general by date

  From Date Subject
Next Message Keith L. Musser 2000-10-31 00:59:06 SQL question - problem with INTERSECT
Previous Message Tim Kientzle 2000-10-30 22:42:51 Re: Listserver problems?