Chained table entries - Mailing list pgsql-general

From Roderick A. Anderson
Subject Chained table entries
Date
Msg-id Pine.LNX.4.10.10010301513090.4776-100000@altoplanos.net
Whole thread Raw
List 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@altoplanos.net               Altoplanos Information Systems, Inc.
Voice: 208.765.6149                            212 S. 11th Street, Suite 5
FAX: 208.664.5299                                  Coeur d'Alene, ID 83814


pgsql-general by date:

Previous
From: Tim Kientzle
Date:
Subject: Re: Listserver problems?
Next
From: "elein"
Date:
Subject: RE: FW: Another array question: Join on array elements