DOMAIN constraints bug or feature - Mailing list pgsql-general

From Viacheslav N Tararin
Subject DOMAIN constraints bug or feature
Date
Msg-id 3E4A1BB2.9050804@dekasoft.com.ua
Whole thread Raw
List pgsql-general
Hi.

Have next problem DOMAIN constraints ommited in table definition.

--- TEST FILE ---
create domain ID_DOMAIN      integer      not null;
create table test (
    ID    ID_DOMAIN,
    NOTES text      NOT NULL
);

\d test;

alter table test add constraint test_pk primary key (ID);

--- OUTPUT ---
CREATE DOMAIN
CREATE TABLE
      Table "public.test"
 Column |   Type    | Modifiers
--------+-----------+-----------
 id     | id_domain |
 notes  | text      | not null

psql:test.sql:9: ERROR:  Existing attribute "id" cannot be a PRIMARY KEY
because it is not marked NOT NULL
---

Why NOT NULL modifier for ID_DOMAIN not present in the test table
definition?

Thanks



pgsql-general by date:

Previous
From: bruno peracchio
Date:
Subject: view w/pgaccess
Next
From: "kanchana"
Date:
Subject: readline doubt with postgresql (on HP-UX)