Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-07-03 Thread Tom Lane
Noah Misch writes: > On Mon, May 30, 2022 at 05:20:15PM -0400, Tom Lane wrote: >> [allow EXEC SQL TYPE unreserved_keyword IS ...] > I didn't locate any problems beyond the test and doc gaps that you mentioned, > so I've marked this Ready for Committer. Thanks! Here's a fleshed-out version with

Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-07-03 Thread Noah Misch
On Mon, May 30, 2022 at 05:20:15PM -0400, Tom Lane wrote: [allow EXEC SQL TYPE unreserved_keyword IS ...] > 1. In pgc.l, if an identifier is a typedef name, ignore any possible > keyword meaning and return it as an IDENT. (I'd originally supposed > that we'd want to return some new TYPEDEF token

Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-05-31 Thread Andrew Dunstan
On 2022-05-29 Su 16:19, Tom Lane wrote: > More generally, I feel like we have a process problem: there needs to > be a higher bar to adding new fully- or even partially-reserved words. > I might've missed it, but I don't recall that there was any discussion > of the compatibility implications of

Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-05-30 Thread Tom Lane
Michael Meskes writes: >> This seems to be because what follows ecpgstart can be either a general >> SQL statement or an ECPGVarDeclaration (beginning with var_type), >> and bison isn't smart enough to disambiguate. I have a feeling that >> this situation could be improved with enough elbow greas

Re: SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-05-30 Thread Michael Meskes
> I looked briefly at whether we could improve that situation. > Two of the four uses of ECPGColLabelCommon in ecpg.trailer can be > converted to the more general ECPGColLabel without difficulty, > but trying to change either of the uses in var_type results in > literally thousands of shift/reduce

SQL/JSON functions vs. ECPG vs. STRING as a reserved word

2022-05-29 Thread Tom Lane
Commit 1a36bc9db (SQL/JSON query functions) introduced STRING as a type_func_name_keyword. As per the complaint at [1], this broke use of "string" as a table name, column name, function parameter name, etc. The restriction about column names, in particular, seems likely to break boatloads of appli