Re: Schema variables - new implementation for Postgres 15
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Sergey Shinderuk <s.shinderuk@postgrespro.ru>,
Tomas Vondra <tomas.vondra@enterprisedb.com>, Julien Rouhaud <rjuju123@gmail.com>, dean.a.rasheed@gmail.com, er@xs4all.nl, joel@compiler.org, pgsql-hackers@lists.postgresql.org
Date: 2024-01-29T07:57:42Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow underscores in integer and numeric constants.
- faff8f8e47f1 16.0 cited
-
Remove special outfuncs/readfuncs handling of RangeVar.catalogname.
- 3cece34be842 16.0 cited
-
Remove extra space from dumped ALTER DEFAULT PRIVILEGES.
- 2af33369e794 16.0 cited
-
Create FKs properly when attaching table as partition
- b0284bfb1db5 16.0 cited
-
psql: improve tab-complete's handling of variant SQL names.
- 02b8048ba5dc 15.0 cited
Attachments
- v20240129-0017-expression-with-session-variables-can-be-inlined.patch (text/x-patch) patch v20240129-0017
- v20240129-0016-GUC-session_variables_ambiguity_warning.patch (text/x-patch) patch v20240129-0016
- v20240129-0014-allow-parallel-execution-queries-with-session-variab.patch (text/x-patch) patch v20240129-0014
- v20240129-0018-this-patch-changes-error-message-column-doesn-t-exis.patch (text/x-patch) patch v20240129-0018
- v20240129-0015-plpgsql-implementation-for-LET-statement.patch (text/x-patch) patch v20240129-0015
- v20240129-0012-Implementation-of-NOT-NULL-and-IMMUTABLE-clauses.patch (text/x-patch) patch v20240129-0012
- v20240129-0013-allow-read-an-value-of-session-variable-directly-fro.patch (text/x-patch) patch v20240129-0013
- v20240129-0010-Implementation-ON-TRANSACTION-END-RESET-clause.patch (text/x-patch) patch v20240129-0010
- v20240129-0011-Implementation-of-DEFAULT-clause-default-expressions.patch (text/x-patch) patch v20240129-0011
- v20240129-0009-implementation-of-temporary-session-variables.patch (text/x-patch) patch v20240129-0009
- v20240129-0008-plpgsql-tests.patch (text/x-patch) patch v20240129-0008
- v20240129-0007-PREPARE-LET-support.patch (text/x-patch) patch v20240129-0007
- v20240129-0006-EXPLAIN-LET-support.patch (text/x-patch) patch v20240129-0006
- v20240129-0004-DISCARD-VARIABLES.patch (text/x-patch) patch v20240129-0004
- v20240129-0005-memory-cleaning-after-DROP-VARIABLE.patch (text/x-patch) patch v20240129-0005
- v20240129-0003-function-pg_session_variables-for-cleaning-tests.patch (text/x-patch) patch v20240129-0003
- v20240129-0002-Storage-for-session-variables-and-SQL-interface.patch (text/x-patch) patch v20240129-0002
- v20240129-0001-Enhancing-catalog-for-support-session-variables-and-.patch (text/x-patch) patch v20240129-0001
Hi
ne 28. 1. 2024 v 19:00 odesílatel Dmitry Dolgov <9erthalion6@gmail.com>
napsal:
> Thanks for the update, smaller patches looks promising.
>
> Off the list Pavel has mentioned that the first two patches contain a
> bare minimum for session variables, so I've reviewed them once more and
> suggest to concentrate on them first. I'm afraid the memory cleanup
> patch has to be added to the "bare minimum" set as well -- otherwise in
> my tests it was too easy to run out of memory via creating, assigning
> and dropping variables. Unfortunately one can't extract those three
> patches from the series and apply only them, the memory patch would have
> some conflicts. Can you maybe reshuffle the series to have those patches
> (1, 2 + 8) as first three?
>
probably you need too
0006-function-pg_session_variables-for-cleaning-tests.patch and
0007-DISCARD-VARIABLES.patch
6 is necessary for testing of cleaning
> If that's possible, my proposal would be to proceed with them first. To the
> best of my knowledge they look good to me, except few minor details:
>
> * The documentation says in a couple of places (ddl.sgml,
> create_variable.sgml) that "Retrieving a session variable's value
> returns either a NULL or a default value", but as far as I see the
> default value feature is not implemented within first two patches.
>
should be fixed
>
> * Similar with mentioning immutable session variables in plpgsql.sgml .
>
fixed
>
> * Commentary to LookupVariable mentions a rowtype_only argument:
>
> +/*
> + * Returns oid of session variable specified by possibly
> qualified identifier.
> + *
> + * If not found, returns InvalidOid if missing_ok, else throws
> error.
> + * When rowtype_only argument is true the session variables of not
> + * composite types are ignored. This should to reduce possible
> collisions.
> + */
> +Oid
> +LookupVariable(const char *nspname,
> + const char *varname,
> + bool missing_ok)
>
> but the function doesn't have it.
>
removed
Regards
Pavel
>
> * I've noticed an interesting result when a LET statement is used to
> assign a
> value without a subquery:
>
> create variable test as text;
> -- returns NULL
> select test;
>
> -- use repeat directly without a subquery
> let test = repeat("test", 100000);
>
> -- returns NULL
> select test;
>
> I was expecting to see an error here, is this a correct behaviour?
>