Re: Rethinking plpgsql's assignment implementation
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Chapman Flack <chap@anastigmatix.net>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-03T15:25:33Z
Lists: pgsql-hackers
Hi I continue in review. I found inconsistency in work with slicings (this is not directly related to this patch, but can be interesting, because with new functionality the array slicings can be edited more often). a = array[1,2,3,4,5]; a[1:5] = 10; -- correctly fails, although for some people can be more natural semantic setting a[1..5] to value 10 a[1:5] = NULL; does nothing - no fail, no value change ??? Is it correct a[1:5] = ARRAY[1]; -- correctly fails ERROR: source array too small but a[1:5] = ARRAY[1,2,3,4,5,6]; -- this statement works, but 6 is ignored. Is it correct? I expected "source array too big" More, this behave is not documented anything other looks well, all tests passed, and in my benchmarks I don't see any slowdowns , so I'll mark this patch as ready for committer Regards Pavel
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