pg_dump and inherits issue

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump and inherits issue
Date: 2006-07-12 13:06:33
Message-ID: 20060712130147.M26133@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have an issue with pg_dump and inherits with pg 8.1.3 and 8.1.4

if I run the following SQL
create table t (a text check (a = '*'));
create table s () inherits (t);
alter table s drop constraint t_a_check;
alter table s add constraint a_check check (a='s');

I get the following
Table "public.t"
Column | Type | Modifiers
--------+------+-----------
a | text |
Check constraints:
"t_a_check" CHECK (a = '*'::text)

Table "public.s"
Column | Type | Modifiers
--------+------+-----------
a | text |
Check constraints:
"a_check" CHECK (a = 's'::text)
Inherits: t

and then create a new database and run
pg_dump old_db |psql new_db

I get the following
Table "public.t"
Column | Type | Modifiers
--------+------+-----------
a | text |
Check constraints:
"t_a_check" CHECK (a = '*'::text)

Table "public.s"
Column | Type | Modifiers
--------+------+-----------
a | text |
Check constraints:
"a_check" CHECK (a = 's'::text)
"t_a_check" CHECK (a = '*'::text)
Inherits: t

The check constraints on table s are not like the original, I have an extra t_a_check constraint. Is this correct?

Jim

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2006-07-12 13:07:48 Updateable views for 8.2 or 8.3?
Previous Message Peter Eisentraut 2006-07-12 12:52:41 Re: [PATCHES] kerberos related warning