Add check constraint bug

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Add check constraint bug
Date: 2002-09-05 21:37:47
Message-ID: Pine.LNX.4.44.0209052239260.945-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following happens in latest CVS and a fresh database:

create table test (a int);
insert into test values (1);
alter table test add column b text check (b <> '');
alter table test add check (a > 0);
alter table test add check (a <> 1);

After the last command I get

ERROR: CheckConstraintFetch: unexpected record found for rel test

and then the table seems to be wedged because any access to it will get
the same error.

Also, psql seems to forget about check constraints in peculiar ways:

create table test (a int);
insert into test values (1);
alter table test add column b text check (b <> '');
\d test
alter table test add check (a > 0);
\d test

The first shows:

Table "public.test"
Spalte | Typ | Attribute
--------+---------+-----------
a | integer |
b | text |

The second shows:

Table "public.test"
Spalte | Typ | Attribute
--------+---------+-----------
a | integer |
b | text |
Check-Constraints: »test_b« (b <> ''::text)
»$1« (a > 0)

Note the first one doesn't show any constraints.

--
Peter Eisentraut peter_e(at)gmx(dot)net

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-09-05 21:38:10 Re: Multibyte support in oracle_compat.c
Previous Message Hannu Krosing 2002-09-05 20:59:13 Re: beta1 packaged