On Sun, 4 Nov 2001, Matthew L. Wirges wrote:
>This line:
>address_type VARCHAR(30) DEFAULT 'unknown' NOT NULL CHECK(address_type
>IN ("unknown", "forged", "proxy", "temporary", "permanent"))
>gives the error:
>psql:IRDB_POSTGRES:69: ERROR: Attribute 'unknown' not found
[snip]
>Is the SQL wrong? Is it just not possible to do this? Or is this a
>possible bug?
No, the problem is that you're specifying string constants with
double-quotes, not single-quotes. ;) Double-quotes are for identifiers,
not constants.
Change it to read like this, and you'll be set:
address_type VARCHAR(30)
DEFAULT 'unknown'
NOT NULL
CHECK(address_type IN
('unknown', 'forged', 'proxy', 'temporary', 'permanent'))
Regards,
Jw.
--
by way of pgsql-general@commandprompt.com