Re: Rethinking plpgsql's assignment implementation
Chapman Flack <chap@anastigmatix.net>
From: Chapman Flack <chap@anastigmatix.net>
To: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@lists.postgresql.org
Date: 2020-12-11T18:09:16Z
Lists: pgsql-hackers
On 12/11/20 12:21, Tom Lane wrote: > solution I adopted was just to invent a new CoercionContext value > COERCION_PLPGSQL, representing "use pl/pgsql's rules". (Basically > what that means nowadays is to apply CoerceViaIO if assignment cast > lookup doesn't find a cast pathway.) That seems like a rule that might be of use in other PLs or extensions; could it have a more generic name, COERCION_FALLBACK or something? > is now quoted, but the "SET n:" bit in front of it might confuse people, > especially if we don't document this new syntax (which I'm inclined not > to, since it's useless in straight SQL). If it's true that the only choices for n: are 1: or 2:, maybe it would look less confusing in an error message to, hmm, decree that this specialized SET form /always/ takes a two-component name, but accept something special like ROUTINE.x (or UNNAMED.x or NULL.x or something) for the case where there isn't a qualifying label in the plpgsql source? It's still a strange arbitrary creation, but might give more of a hint of its meaning if it crops up in an error message somewhere. Regards, -Chap
Commits
-
Rethink the "read/write parameter" mechanism in pl/pgsql.
- 1c1cbe279b3c 14.0 landed
-
Remove PLPGSQL_DTYPE_ARRAYELEM datum type within pl/pgsql.
- 1788828d3351 14.0 landed
-
Re-implement pl/pgsql's expression and assignment parsing.
- c9d5298485b7 14.0 landed
-
Add the ability for the core grammar to have more than one parse target.
- 844fe9f159a9 14.0 landed
-
Support subscripting of arbitrary types, not only arrays.
- c7aba7c14efd 14.0 cited
-
Improve handling of array elements as getdiag_targets and cursor_variables.
- 55caaaeba877 10.0 cited