Tom Lane wrote:
Matthew Nourse writes:
As NOT NULL on domains doesn't always prevent a value from becoming NULL
(and because it "sucks" :) ) would you consider deprecating the
not-null-on-domains feature and then removing it from some future
version of PostgreSQL?
We can't really because it
Matthew Nourse writes:
> As NOT NULL on domains doesn't always prevent a value from becoming NULL
> (and because it "sucks" :) ) would you consider deprecating the
> not-null-on-domains feature and then removing it from some future
> version of PostgreSQL?
We can't really because it's required
Kevin Grittner wrote:
Tom Lane wrote:
< NOT NULL constraints at the domain level suck. Don't use 'em.
+1
As someone who uses domains very heavily, I can attest that the
semantics of that are very weak. Whether a domain is nullable
depends almost entirely on the context of its use, which
Applied.
---
Bruce Momjian wrote:
> Tom Lane wrote:
> > "Matt Nourse" writes:
> > > CREATE DOMAIN test_id_domain INT NOT NULL;
> > > CREATE TABLE test_state(id test_id_domain PRIMARY KEY, display_value
> > > varchar(20) NO
Tom Lane wrote:
< NOT NULL constraints at the domain level suck. Don't use 'em.
+1
As someone who uses domains very heavily, I can attest that the
semantics of that are very weak. Whether a domain is nullable
depends almost entirely on the context of its use, which you can't
(and shouldn't
Tom Lane wrote:
> "Matt Nourse" writes:
> > CREATE DOMAIN test_id_domain INT NOT NULL;
> > CREATE TABLE test_state(id test_id_domain PRIMARY KEY, display_value
> > varchar(20) NOT NULL);
> > CREATE TABLE test_city(state_id test_id_domain REFERENCES test_state(id));
>
> > This produces an error a
"Matt Nourse" writes:
> CREATE DOMAIN test_id_domain INT NOT NULL;
> CREATE TABLE test_state(id test_id_domain PRIMARY KEY, display_value
> varchar(20) NOT NULL);
> CREATE TABLE test_city(state_id test_id_domain REFERENCES test_state(id));
> This produces an error as expected:
> INSERT INTO tes
The following bug has been logged online:
Bug reference: 5477
Logged by: Matt Nourse
Email address: matt...@nplus1.com.au
PostgreSQL version: 8.4
Operating system: Linux (Debian and Red Hat)
Description:CREATE DOMAIN NOT NULL constraints not always enforced
for INSERT