Re: Question about the enum type - Mailing list pgsql-general

From Tom Lane
Subject Re: Question about the enum type
Date
Msg-id 7166.1203312066@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question about the enum type  (Tim Hart <tjhart@mac.com>)
Responses Re: Question about the enum type
List pgsql-general
Tim Hart <tjhart@mac.com> writes:
> On Feb 17, 2008, at 10:41 PM, Chris wrote:
> It's a string manipulation function:
> http://www.postgresql.org/docs/8.3/interactive/functions-string.html

> If the issue were simply that it were a function name, than I would
> have expected that attempting to create an enum type of 'abs' to also
> result in a quoted type.

The reason "position" is special is that the SQL spec calls out weird
specialized syntax for it:

         <string position expression> ::=
              POSITION <left paren> <string value expression>
                  IN <string value expression> <right paren>

There's no way to handle this random use of IN rather than comma,
except by having a specialized grammar production, which requires
POSITION to be a keyword.

In contrast, "abs" isn't a keyword at all in Postgres' eyes --- it's
just a function that happens to appear in the system catalogs.

            regards, tom lane

pgsql-general by date:

Previous
From: Tim Hart
Date:
Subject: Re: Question about the enum type
Next
From: Keaton Adams
Date:
Subject: Re: Why isn't an index being used when selecting a distinct value?