Re: Schema variables - new implementation for Postgres 15

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Jaime Casanova <jcasanov@systemguards.com.ec>, Erik Rijkers <er@xs4all.nl>, Gilles Darold <gilles@darold.net>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Michael Paquier <michael@paquier.xyz>, Amit Kapila <amit.kapila16@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>
Date: 2021-11-17T16:05:57Z
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 →
  1. Allow underscores in integer and numeric constants.

  2. Remove special outfuncs/readfuncs handling of RangeVar.catalogname.

  3. Remove extra space from dumped ALTER DEFAULT PRIVILEGES.

  4. Create FKs properly when attaching table as partition

  5. psql: improve tab-complete's handling of variant SQL names.

Hi

8) immutable variables without a default value
>
> IMO this case should not be allowed. On 2021/08/29 you wrote:
>
>     I thought about this case, and I have one scenario, where this
>     behaviour can be useful. When the variable is declared as IMMUTABLE
>     NOT NULL without not null default, then any access to the content of
>     the variable has to fail. I think it can be used for detection,
>     where and when the variable is first used. So this behavior is
>     allowed just because I think, so this feature can be interesting for
>     debugging. If this idea is too strange, I have no problem to disable
>     this case.
>

I checked code, and this case is disallowed already

postgres=# CREATE IMMUTABLE VARIABLE xx AS int NOT NULL;
ERROR:  IMMUTABLE NOT NULL variable requires default expression

Regards

Pavel