Re: Table definitions using CHECK and DEFAULT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matthew L(dot) Wirges" <wirges(at)cerias(dot)purdue(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table definitions using CHECK and DEFAULT
Date: 2001-11-05 01:04:11
Message-ID: 10475.1004922251@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Matthew L. Wirges" <wirges(at)cerias(dot)purdue(dot)edu> writes:
> 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

You must use single quotes not double quotes for literal strings.
Double-quotes are for names that don't follow standard identifier
rules.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aasmund Midttun Godal 2001-11-05 01:27:29 Re: newbie question
Previous Message Tom Lane 2001-11-05 01:01:54 Re: Got error on CREATE TABLE AS (+Bug?)