Re: Schema variables - new implementation for Postgres 15

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Joel Jacobson <joel(at)compiler(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Schema variables - new implementation for Postgres 15
Date: 2022-08-20 18:09:20
Message-ID: CAFj8pRAMW0Tjt4jiVJVGQC4OsQM78M=1Jr49OMtW9DHEvzcH2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

so 20. 8. 2022 v 16:35 odesílatel Julien Rouhaud <rjuju123(at)gmail(dot)com>
napsal:

> On Sat, Aug 20, 2022 at 03:55:07PM +0200, Erik Rijkers wrote:
> >
> > Op 20-08-2022 om 15:41 schreef Pavel Stehule:
> > > so 20. 8. 2022 v 15:36 odesílatel Erik Rijkers <er(at)xs4all(dot)nl> napsal:
> > >
> > > > Op 20-08-2022 om 15:32 schreef Erik Rijkers:
> > > > > Op 19-08-2022 om 17:29 schreef Pavel Stehule:
> > > > >
> > > > > make check fails as a result of the errors in the attached
> > > > > session_variables.out.
> > > > >
> > > >
> > > >
> > > > Sorry, that should have been this diffs file, of course (attached).
> > > >
> > >
> > > It looks like some problem with not well initialized memory, but I
> have no
> > > idea how it is possible. What are your configure options?
> > >
> >
> > I compiled both assert-enable and 'normal', and I only just noticed that
> the
> > assert-enable one did pass tests normally.
> >
> >
> > Below is the config that produced the failing tests:
> >
> > ./configure
> > --prefix=/home/aardvark/pg_stuff/pg_installations/pgsql.schema_variables
> --bindir=/home/aardvark/pg_stuff/pg_installations/pgsql.schema_variables/bin.fast
> --libdir=/home/aardvark/pg_stuff/pg_installations/pgsql.schema_variables/lib.fast
> > --with-pgport=6986 --quiet --enable-depend --with-openssl --with-perl
> > --with-libxml --with-libxslt --with-zlib --enable-tap-tests
> > --with-extra-version=_0820_schema_variables_1509 --with-lz4
> --with-icu
>
> I also tried locally (didn't look at the patch yet), with debug/assert
> enabled,
> and had similar error:
>
> diff -dU10
> /Users/rjuju/git/postgresql/src/test/regress/expected/session_variables.out
> /Users/rjuju/git/pg/pgmaster_debug/src/test/regress/results/session_variables.out
> ---
> /Users/rjuju/git/postgresql/src/test/regress/expected/session_variables.out
> 2022-08-20 22:25:17.000000000 +0800
> +++
> /Users/rjuju/git/pg/pgmaster_debug/src/test/regress/results/session_variables.out
> 2022-08-20 22:30:50.000000000 +0800
> @@ -983,23 +983,23 @@
> -- should to fail
> SELECT public.svar;
> svar
> ---------
> (10,20)
> (1 row)
>
> ALTER TYPE public.svar_test_type ADD ATTRIBUTE c int;
> -- should to fail too (different type, different generation number);
> SELECT public.svar;
> - svar
> -----------
> - (10,20,)
> + svar
> +--------------------
> + (10,20,2139062142)
> (1 row)
>
> LET public.svar = ROW(10,20,30);
> -- should be ok again for new value
> SELECT public.svar;
> svar
> ------------
> (10,20,30)
> (1 row)
>
> @@ -1104,31 +1104,31 @@
> (1 row)
>
> DROP VARIABLE public.svar;
> DROP TYPE public.svar_test_type;
> CREATE TYPE public.svar_test_type AS (a int, b int);
> CREATE VARIABLE public.svar AS public.svar_test_type;
> CREATE VARIABLE public.svar2 AS public.svar_test_type;
> LET public.svar = (10, 20);
> ALTER TYPE public.svar_test_type ADD ATTRIBUTE c int;
> SELECT public.svar;
> - svar
> -----------
> - (10,20,)
> + svar
> +------------
> + (10,20,16)
> (1 row)
>
> LET public.svar2 = (10, 20, 30);
> ALTER TYPE public.svar_test_type DROP ATTRIBUTE b;
> SELECT public.svar;
> - svar
> --------
> - (10,)
> + svar
> +---------
> + (10,16)
> (1 row)
>
> SELECT public.svar2;
> svar2
> ---------
> (10,30)
> (1 row)
>

I hope so I found this error. It should be fixed

Regards

Pavel

Attachment Content-Type Size
v20220820-1-0012-documentation.patch text/x-patch 42.2 KB
v20220820-1-0011-This-patch-changes-error-message-column-doesn-t-exis.patch text/x-patch 25.2 KB
v20220820-1-0010-Regress-tests-for-session-variables.patch text/x-patch 43.7 KB
v20220820-1-0008-Possibility-to-dump-session-variables-by-pg_dump.patch text/x-patch 19.4 KB
v20220820-1-0009-typedefs.patch text/x-patch 1.6 KB
v20220820-1-0007-Enhancing-psql-for-session-variables.patch text/x-patch 15.1 KB
v20220820-1-0006-DISCARD-VARIABLES-command.patch text/x-patch 3.2 KB
v20220820-1-0004-LET-command.patch text/x-patch 38.1 KB
v20220820-1-0005-Support-of-LET-command-in-PLpgSQL.patch text/x-patch 11.5 KB
v20220820-1-0003-typecheck-check-of-consistency-of-format-of-stored-v.patch text/x-patch 40.8 KB
v20220820-1-0002-session-variables.patch text/x-patch 92.0 KB
v20220820-1-0001-Catalogue-support-for-session-variables.patch text/x-patch 97.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2022-08-20 18:10:39 Re: Schema variables - new implementation for Postgres 15
Previous Message Andres Freund 2022-08-20 18:01:39 Re: [RFC] building postgres with meson - v11