So last time I checked this wasn't possible (at least not that anyone
has told me). I'd like to be able to create constraints that aren't
tied to a specific table/column.

I think that the syntax would look something like this

CREATE CONSTRAINT empty CHECK (VALUE = '\0' );

this should allow us to do thinks like

CREATE TABLE users (
              username TEXT NOT empty
);

the example from create domain (modified)  is also pretty good

CREATE CONSTRAINT zip CHECK(
   VALUE ~ '^\\d{5}$'
OR VALUE ~ '^\\d{5}-\\d{4}$'
);

-- 
Caleb Cushing

http://xenoterracide.blogspot.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to