Add check constraint bug

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Add check constraint bug
Дата
Msg-id Pine.LNX.4.44.0209052239260.945-100000@localhost.localdomain
обсуждение исходный текст
Ответы Re: Add check constraint bug  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Add check constraint bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@gmx.net



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: beta1 packaged
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Multibyte support in oracle_compat.c