You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Re-implement pl/pgsql's expression and assignment parsing.
Invent new RawParseModes that allow the core grammar to handlepl/pgsql expressions and assignments directly, and thereby get ridof a lot of hackery in pl/pgsql's parser. This moves a good dealof knowledge about pl/pgsql into the core code: notably, we have toinvent a CoercionContext that matches pl/pgsql's (rather dubious)historical behavior for assignment coercions. That's getting awayfrom the original idea of pl/pgsql as an arm's-length extension ofthe core, but really we crossed that bridge a long time ago.The main advantage of doing this is that we can now use the coreparser to generate FieldStore and/or SubscriptingRef nodes to handleassignments to pl/pgsql variables that are records or arrays. Thatfixes a number of cases that had never been implemented in pl/pgsqlassignment, such as nested records and array slicing, and it allowspl/pgsql assignment to support the datatype-specific subscriptingbehaviors introduced in commitc7aba7c.There are cosmetic benefits too: when a syntax error occurs in apl/pgsql expression, the error report no longer includes the confusing"SELECT" keyword that used to get prefixed to the expression text.Also, there seem to be some small speed gains.Discussion:https://postgr.es/m/4165684.1607707277@sss.pgh.pa.us