pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: SZŰCS Gábor <surrano@mailbox.hu>
To: pgsql-sql@postgresql.org
Subject: Constraint->function dependency and dump in 7.3
Date: Thu, 8 Jul 2004 13:09:54 +0200
Message-ID: <002801c464dc$196c09b0$0403a8c0@fejleszt4> (raw)

Dear Gurus,

Just recently realized that our daily dump from a 7.3 (production) db to a
7.4 (development) server has problems. I have no idea where to search for an
answer so please feel free to point me to the appropriate thread, doc or TFM
:)

Below is two portions of the dump, which seems to be in the wrong order (at
least for me). I'm not sure, and not in a position to easily test it, that
it's wrong order in 7.3; but 7.4 has problems creating the table without the
function (which is logical):

%----------------------- cut here -----------------------%
CREATE TABLE cim (
    -- etc etc ...
    orszag_kod integer,
    CONSTRAINT cim_orszag_kod CHECK ((hely_fajta(orszag_kod) = 7))
);

-- ... several lines later:

CREATE FUNCTION hely_fajta (integer) RETURNS integer
    AS ' ... '
    LANGUAGE sql;
%----------------------- cut here -----------------------%

Checked pg_depend, and constraint cim_orszag_kod refers to function
hely_fajta, but noone (not even the table) refers to the constraint. I'm
just wondering if it's ok...

1) is it normal that the table does not refer to its constraints?
2) if not, do you have the idea of the possible cause?
3) if so, is it normal for pg_dump to dump in this order?
4) if so, how may I change it?
5) may inserting into pg_depend solve the problem?

TIA,
G.
%----------------------- cut here -----------------------%
\end




view thread (11+ messages)  latest in thread

Message-ID: <002801c464dc$196c09b0$0403a8c0@fejleszt4>
Permalink:  ../002801c464dc$196c09b0$0403a8c0@fejleszt4/
Also on:    postgresql.org/message-id/002801c464dc$196c09b0$0403a8c0@fejleszt4

 · 

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-sql@postgresql.org
  Cc: surrano@mailbox.hu
  Subject: Re: Constraint->function dependency and dump in 7.3
  In-Reply-To: <002801c464dc$196c09b0$0403a8c0@fejleszt4>

* 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