Re: pg_dumpall and check constraints

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Guillaume Perréal <perreal(at)lyon(dot)cemagref(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall and check constraints
Date: 2000-06-30 12:41:17
Message-ID: 3.0.5.32.20000630224117.009c2150@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 |/

Attachment Content-Type Size
unknown_filename text/enriched 1.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeffery Collins 2000-06-30 12:47:02 Re: Large Tables(>1 Gb)
Previous Message Jochen Weyermanns 2000-06-30 12:08:17 ecpg and include files