Re: [BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-30 Thread Matthew Nourse
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

Re: [BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-30 Thread Tom Lane
Matthew Nourse matt...@nplus1.com.au 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

Re: [BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-29 Thread Kevin Grittner
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

Re: [BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-29 Thread Bruce Momjian
Applied. --- Bruce Momjian wrote: Tom Lane wrote: Matt Nourse matt...@nplus1.com.au writes: CREATE DOMAIN test_id_domain INT NOT NULL; CREATE TABLE test_state(id test_id_domain PRIMARY KEY, display_value

[BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-28 Thread Matt Nourse
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

Re: [BUGS] BUG #5477: CREATE DOMAIN NOT NULL constraints not always enforced for INSERT with subquery

2010-05-28 Thread Tom Lane
Matt Nourse matt...@nplus1.com.au 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: