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

From Tom Lane
Subject Re: [HACKERS] Re: Arrays versus 'type constant' syntax
Date
Msg-id 28261.931989501@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:
> Well, ahem, er...
> It isn't an explicit general construct in SQL92, since there are only
> a few data types defined in the language, and since type extensibility
> is not supported.
> However, the language does define syntax for specifying date/time
> literals (the only string-like literal which is not a string type) and
> that would seem to suggest the general solution. 

Hmm.  OK, then, we're stuck with a tradeoff that (fortunately) only
affects arrays.  Is it better to force subscripted column names to be
fully qualified "table.column[subscripts]" (the current situation),
or to allow bare column names to be subscripted at the cost of requiring
casts from string constants to array types to use the long-winded CAST
notation (or nonstandard :: notation)?

I would guess that the cast issue comes up *far* less frequently than
subscripting, so we'd be better off changing the behavior.  But the
floor is open for discussion.

I have this change implemented and tested here, btw, but I won't check
it in until I see if there are objections...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: 6.5.1 release
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Counting bool flags in a complex query