At 09:59 30/06/00 +0200, Guillaume Perréal wrote:
>>>>
<excerpt>
And the question is: Is there a better way to do what I want (checking
field values from different tables against data in one table) that allow
pg_dumpall to works ?
</excerpt><<<<<<<<
I'm not sure what to suggest, but a FOREIGN KEY constraint might help.
You would need to do one of two things:
1. add fieldname to the definition of station, then use
FOREIGN KEY ("fieldname", "type") references "information"
(fieldName, code),
OR
2. create a view:
create view "station_fields" as select * from information where
fieldname = 'station.type';
then use:
FOREIGN KEY ( "type") references "station_fields" ( code),
You'd need to assess the permance issues associated with each choice -
some DB systems don't do views very well, and I have absolutely no
experience with big views under PG.
FWIW, I have just finished writing a modified pg_dump which restores
things in a variety of possibl orders, and works with the example you
quoted.
I'm just waiting on volunteers to test it...
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/