Re: Arrays versus 'type constant' syntax - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Arrays versus 'type constant' syntax
Date
Msg-id 25800.931967880@sss.pgh.pa.us
Whole thread Raw
In response to Re: Arrays versus 'type constant' syntax  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> 2. Remove "AexprConst ::= Typename Sconst" from the grammar.  I do
>> not believe this rule is in SQL92.

> Sorry, this *is* SQL92 syntax.

I've just grepped the SQL92 spec in some detail, and I see noplace
that allows "typename stringconstant".  "::" is indeed not standard,
but the only type conversion syntax I see in the spec isCAST (value AS type)

If I'm missing something, please cite chapter and verse.

>> 3. Simplify the AexprConst rule to only allow a subset of Typename
>> --- it looks like forbidding array types in this context is enough.
>> (You could still write a cast using :: or AS, of course, instead of
>> "int4[3] '{1,2,3}'".  The latter has never worked anyway.)
>> I'm leaning to choice #3, but I wonder if anyone has a better idea.

> I don't have a strong opinion about what #3 would introduce as far as
> future constraints.

If "typename stringconstant" actually is standard then we have a
problem, because I would not like to forbid array types in a standard
construct.  But the grammar is not LALR(1) in the presence of array
types, so we may not have much choice...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Ansley, Michael"
Date:
Subject: RE: [HACKERS] MAX Query length
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] MAX Query length