From: | Kovacs Zoltan Sandor <tip(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | pg_dump + function/table hierarchy |
Date: | 2000-07-29 19:18:17 |
Message-ID: | Pine.LNX.4.05.10007292116340.11253-100000@pc10.radnoti-szeged.sulinet.hu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Unfortunately I managed to create a problematic database. The problem
occurs if I execute pg_dump and then try to reload the database. Details:
My only definitions in this database are:
> create function x(int4) returns bool as 'select $1 > 10;' language 'sql';
> create table y(z int4 check(x(z)));
Then, after pg_dump I got the next dump:
\connect - postgres
CREATE TABLE "y" (
"z" int4,
CONSTRAINT "y_z" CHECK (x(z))
);
CREATE FUNCTION "x" (int4 ) RETURNS bool AS 'select $1 > 10;' LANGUAGE 'SQL';
COPY "y" FROM stdin;
\.
Then, loading this dump back into the dropped and recreated database, I
got error messages, because the FUNCTION "x" is not created before the
TABLE "y".
The problem doesn't seems to be solved too easily. In fact, it is not a
good solution that FUNCTIONs are dumped before the TABLEs, because
the 'SQL' FUNCTIONs use the TABLEs in general (and the parser tries to
detect the SQL query). What to do? We need to store some kind of hierarchy
between table and function definitions, and after that could we say
something about the regenerating order. Of course, it needs at least one
new table among the system tables and needs pg_dump to be a bit more
complicated.
Regards,
Zoltan
------------------------------------------------------------------------------
KOVACS, Zoltan tip(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2000-07-29 23:23:02 | Re: Hmm, should ACL[] be toastable? |
Previous Message | Tom Lane | 2000-07-29 19:08:39 | Hmm, should ACL[] be toastable? |