From: | Guillaume Perréal <perreal(at)lyon(dot)cemagref(dot)fr> |
---|---|
To: | Philip Warner <pjw(at)rhyme(dot)com(dot)au> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: pg_dumpall and check constraints |
Date: | 2000-06-30 13:35:06 |
Message-ID: | 395CA20A.2C264789@lyon.cemagref.fr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Philip Warner wrote:
> At 09:59 30/06/00 +0200, Guillaume Perréal wrote:
> >>>>
>
> 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 ?
>
> <<<<
>
> 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),
Well, I don't think adding the same value to each row of "station" is the better solution. But it's a solution.
>
> 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),
I tried : it doesn't work. It seems that view rows don't have OID, which are used in foreign key. (I deduce that from the error messages I've got when I tried).
>
>
> 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.
"information" won't be a big view : less than one hundred tuples.
>
>
> 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...
Why not? But I can't promise you to do full testing as I've got a lot of work these days.
Thanks.
--
Guillaume Perréal - Stagiaire MIAG
Cemagref (URH), Lyon, France
Tél: (+33) 4.72.20.87.64
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 2000-06-30 13:38:34 | Re: Timezone template for to_char(timestamp, '...')? |
Previous Message | Jeffery Collins | 2000-06-30 12:47:02 | Re: Large Tables(>1 Gb) |