pg_dump bug in 7.4

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_dump bug in 7.4
Date: 2003-09-29 01:14:03
Message-ID: 20030929011403.GA32665@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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';

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2003-09-29 01:51:09 Re: pgsql-server/src/backend catalog/index.c comma ...
Previous Message Tom Lane 2003-09-29 00:36:32 Re: pgsql-server/src/backend catalog/index.c comma ...