Re: constraints & tableoid [pgsql8.1]

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: constraints & tableoid [pgsql8.1]
Дата
Msg-id 443B6852.7070900@archonet.com
обсуждение исходный текст
Ответ на constraints & tableoid [pgsql8.1]  (维 姜 <jw.pgsql@sduept.com>)
Список pgsql-bugs
=E7=BB=B4 =E5=A7=9C wrote:
> jw=3D# CREATE TABLE base ( CHECK (tableoid =3D 'base'::regclass) );
> CREATE TABLE
> jw=3D# \d base
>     Table "public.base"
>  Column | Type | Modifiers
> --------+------+-----------
> Check constraints:
>     "base_tableoid_check" CHECK (tableoid =3D 'base'::regclass::oid)
>=20
> jw=3D# INSERT INTO base DEFAULT VALUES ;
> ERROR:  new row for relation "base" violates check constraint
> "base_tableoid_check"
> jw=3D#

The CHECK tests the tuple that is being inserted, which doesn't include=20
tableoid. I'm not sure if this counts as a bug or not.

You might be able to do this with a trigger function (although I'm not=20
clear what you're trying to do).

--=20
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: 维 姜
Дата:
Сообщение: constraints & tableoid [pgsql8.1]
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: constraints & tableoid [pgsql8.1]