Re: pg_dump bug in 7.4

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump bug in 7.4
Date: 2003-09-29 03:16:48
Message-ID: 200309290316.h8T3GmD22385@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> If you are referring to my patch, Bruce - that does not fix it. Mine
> only addresses psql.
>
> I don't think that pg_dump uses pg_get_constraintdef(). It's probably a
> side effect of switching from using consrc to conbin.

Oh, yea. If forgot the pretty printing only happens in psql.

Can someone generate a reproducable failure?

---------------------------------------------------------------------------

>
> Chris
>
>
> Bruce Momjian wrote:
> > I have a fix for this in the patch queue and it will be applied in 24
> > hours. If you want to try it, it is at:
> >
> > http://momjian.postgresql.org/cgi-bin/pgpatches
> >
> >
> >
> > ---------------------------------------------------------------------------
> >
> > Bruno Wolff III wrote:
> >
> >>If you have a check constraint that tests if a boolean column is not
> >>false by just using the column name, pg_dump doesn't include parens
> >>around the check constraint which causes a syntax error when reloading
> >>the database.
> >>
> >>Using the following to create a table:
> >>create table test (col1 boolean constraint test check (col1));
> >>
> >>pg_dump -c produced the following:
> >>--
> >>-- PostgreSQL database dump
> >>--
> >>
> >>SET SESSION AUTHORIZATION 'postgres';
> >>
> >>SET SESSION AUTHORIZATION 'bruno';
> >>
> >>SET search_path = public, pg_catalog;
> >>
> >>DROP TABLE public.test;
> >>SET SESSION AUTHORIZATION 'postgres';
> >>
> >>--
> >>-- TOC entry 3 (OID 2200)
> >>-- Name: public; Type: ACL; Schema: -; Owner: postgres
> >>--
> >>
> >>REVOKE ALL ON SCHEMA public FROM PUBLIC;
> >>GRANT ALL ON SCHEMA public TO PUBLIC;
> >>
> >>
> >>SET SESSION AUTHORIZATION 'bruno';
> >>
> >>--
> >>-- TOC entry 4 (OID 605016)
> >>-- Name: test; Type: TABLE; Schema: public; Owner: bruno
> >>--
> >>
> >>CREATE TABLE test (
> >> col1 boolean,
> >> CONSTRAINT test CHECK col1
> >>);
> >>
> >>
> >>--
> >>-- Data for TOC entry 5 (OID 605016)
> >>-- Name: test; Type: TABLE DATA; Schema: public; Owner: bruno
> >>--
> >>
> >>COPY test (col1) FROM stdin;
> >>\.
> >>
> >>
> >>SET SESSION AUTHORIZATION 'postgres';
> >>
> >>--
> >>-- TOC entry 2 (OID 2200)
> >>-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
> >>--
> >>
> >>COMMENT ON SCHEMA public IS 'Standard public schema';
> >>
> >>
> >>
> >>---------------------------(end of broadcast)---------------------------
> >>TIP 8: explain analyze is your friend
> >>
> >
> >
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-09-29 03:26:01 Alter Table Column Datatype
Previous Message Hiroshi Inoue 2003-09-29 03:11:11 Re: 2-phase commit