pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jesper Krogh <jesper@krogh.cc>
To: pgsql-admin@postgresql.org
Subject: Re: Upgrade time, dump+restore trouble.
Date: Wed, 17 Oct 2007 21:11:17 +0200
Message-ID: <47165E55.4020807@krogh.cc> (raw)
In-Reply-To: <7031.1192637434@sss.pgh.pa.us>
References: <471619AD.9020903@krogh.cc>
	<7031.1192637434@sss.pgh.pa.us>

Tom Lane wrote:
> Jesper Krogh <jesper@krogh.cc> writes:
>> The tables are running a "home-made" timetravelling feature where a
>> contraint on the table implements the foreing keys on the table.
> 
> You mean you have check constraints that do selects on other tables?

Yes. We do.. we have to .. in order to perserve the foreing-keys.
What we have in short is:
Added two timestamps on each columns, starttime,endtime. When endtime is
"null" the record is "current" and a view exposes this from the table.
The foreing keys are then implemented using contraints that look up the
id in the foreing table and ensures that there is a record where the
endtime is null present

> You have just found out (one reason) why that's a bad idea.

Do you have any other reasons?

>> How can I instruct pg_dumpall to turn off these constriants during
>> dump/restore?
> 
> Drop the constraints in the source database.

That would be my workaround for the problem. But isn't it somehow
desirable that pg_dumpall | psql "allways" would work?

Jesper
-- 
Jesper Krogh, jesper@krogh.cc




view thread (5+ messages)  latest in thread

Message-ID: <47165E55.4020807@krogh.cc>
Permalink:  ../47165E55.4020807@krogh.cc/
Also on:    postgresql.org/message-id/47165E55.4020807@krogh.cc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jesper@krogh.cc
  Subject: Re: Upgrade time, dump+restore trouble.
  In-Reply-To: <47165E55.4020807@krogh.cc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox