New answers tagged ddl
I wouldn't try to solve that with a DOMAIN since that cannot reference other columns. Use a CHECK constraint instead: ALTER TABLE foo ADD CONSTRAINT foo_min_salary CHECK ( salary > 1000 OR hired < '2013-01-01' AND salary > 500 ) Define the column NOT NULL in addition to disallow NULL values. Using the IS0 8601 format for the date, which is valid ...
You can find out for sure with this query to the system catalog table pg_type: SELECT typtype FROM pg_type WHERE oid = 'finance.fund_part_status'::regtype I quote the manual about pg_type: typtype is b for a base type, c for a composite type (e.g., a table's row type), d for a domain, e for an enum type, p for a pseudo-type, or r for a range ...
Yes, it looks like finance.fund_part_status is an enum type. Assuming you're using the psql command-line interpreter, try this command: \dT+ finance.fund_part_status;
Top 50 recent answers are included