Re: PostgreSQL domains and NOT NULL constraint - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: PostgreSQL domains and NOT NULL constraint
Date
Msg-id 126de91a-7fa8-4552-a5a6-25d51712448b@postgresfriends.org
Whole thread Raw
In response to Re: PostgreSQL domains and NOT NULL constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 10/13/23 06:37, Tom Lane wrote:
> If it's not nominally of a domain type, please cite chapter and
> verse that says it isn't.

Okay, I found it.


SQL:2023-2 6.7 <column reference>

Syntax Rules

5) Let C be the column that is referenced by CR. The declared type of CR is
    Case:
    a) If the column descriptor of C includes a data type, then that 
data type.

    b) Otherwise, the data type identified in the domain descriptor that 
describes the domain that is identified by the <domain name> that is 
included in the column descriptor of C.


So the domain should not be carried into a query expression (including 
views) and the data type should be the one specified in the domain.
-- 
Vik Fearing




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: logical decoding and replication of sequences, take 2
Next
From: Andrew Atkinson
Date:
Subject: Re: [Doc] Glossary Term Definitions Edits