"Karl O. Pinc" <kop@meme.com> writes:
> On 2004.03.04 09:13 Tom Lane wrote:
>> I should have said something
>> like
>> ... constraint "f1 must be positive" check (f1 > 0)
>> if I were concerned about the error message quality.
> I tried this (in 7.3) only using single quotes instead of double quotes
> and got syntax errors. Where do I look in the docs to learn
> about this aspect of the syntax?
Double quotes are for names (identifiers). Single quotes are for string
literals (constants). In this case you're trying to write a nonstandard
name for a constraint, so you want double quotes.
> (I also note that the examples
> often single quote the plpgsql language keyword in CREATE FUNCTION
> statements, but I haven't and although I read through the whole
> manual didn't notice where such quotes are allowed and/or
> required.)
Those examples are old; the preferred syntax these days is to write the
language name as an identifier. But we used to, and still do, accept a
string literal for the language name. This is mentioned (very briefly)
on the CREATE FUNCTION reference page:
langname
The name of the language that the function is implemented in. May
be SQL, C, internal, or the name of a user-defined procedural
language. (See also createlang.) For backward compatibility, the
name may be enclosed by single quotes.
regards, tom lane