dbTalk Databases Forums  

Re: [BUGS] pg_dump of table including check rule fails to restore

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] pg_dump of table including check rule fails to restore in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lewis Foti
 
Posts: n/a

Default Re: [BUGS] pg_dump of table including check rule fails to restore - 12-16-2003 , 03:10 PM






Further to my original message I realise that the problem was due to the
text of the rule still referring to columns, src_section_id and
dst_section_id by their original names, parent_section_id and
child_section_id respectively. So the nature of the bug changes to that
pg_dump does not correctly export CHECK rules where the name of the
column(s) referred to has changed. Now IMHO that is somewhat subtle.

regards

Lewis

-----Original Message-----
From: Lewis Foti [mailto:lewis.foti (AT) mentation (DOT) com]
Sent: 16 December 2003 18:26
To: pgsql-bugs (AT) postgresql (DOT) org
Subject: pg_dump of table including check rule fails to restore


Hi

I have a schema which includes one table with a CHECK constraint. After the
schema is dumped (with pg_dump) as ascii text attempts to recreate it using
the psql -f <filename> command cause this one table, called navigaion, to
fail to create. This is using postgresql 7.3.3 on Redhat 9.0. The fragment
of the dump is below. Is there a cure for this problem?

regards

Lewis

--
-- TOC entry 6 (OID 154551)
-- Name: navigation; Type: TABLE; Schema: public; Owner: wallet
--

CREATE TABLE navigation (
src_section_id integer NOT NULL,
dst_section_id integer NOT NULL,
rank smallint NOT NULL,
CHECK ((parent_section_id <> child_section_id))
) WITHOUT OIDS;

Lewis Foti

e: lewis.foti (AT) mentation (DOT) com
m: +44 (0)7771 535943
w: www.mentation.com



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] pg_dump of table including check rule fails to restore - 12-16-2003 , 03:29 PM






Lewis Foti wrote:
Quote:
I have a schema which includes one table with a CHECK constraint.
After the schema is dumped (with pg_dump) as ascii text attempts to
recreate it using the psql -f <filename> command cause this one
table, called navigaion, to fail to create. This is using postgresql
7.3.3 on Redhat 9.0. The fragment of the dump is below. Is there a
cure for this problem?

CREATE TABLE navigation (
src_section_id integer NOT NULL,
dst_section_id integer NOT NULL,
rank smallint NOT NULL,
CHECK ((parent_section_id <> child_section_id))
) WITHOUT OIDS;
Can you remember how you constructed this table? Did you drop or alter
some columns? Do you have your original table creation script around
or something like that?

Obviously, this table is invalid, but we need to find out how you
arrived there.


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] pg_dump of table including check rule fails to restore - 12-16-2003 , 03:32 PM



Lewis Foti wrote:
Quote:
Further to my original message I realise that the problem was due to
the text of the rule still referring to columns, src_section_id and
dst_section_id by their original names, parent_section_id and
child_section_id respectively. So the nature of the bug changes to
that pg_dump does not correctly export CHECK rules where the name of
the column(s) referred to has changed. Now IMHO that is somewhat
subtle.
This appears to be fixed in 7.4. Upgrading might be your best option
unless you want to backport the pg_dump fix to 7.3.


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.