Re: [HACKERS] proposal: schema variables

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [HACKERS] proposal: schema variables
Date: 2018-12-31 17:33:30
Message-ID: CAFj8pRDxE1uSup-CLZScXd3=iH7JwK2C6VbV4vbjCyYaXU6PRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi

po 31. 12. 2018 v 16:40 odesílatel Erik Rijkers <er(at)xs4all(dot)nl> napsal:

> On 2018-12-31 14:23, Pavel Stehule wrote:
> > st 21. 11. 2018 v 8:24 odesílatel Pavel Stehule
> > <pavel(dot)stehule(at)gmail(dot)com>
>
> > [schema-variables-20181231-01.patch.gz]
>
> Hi Pavel,
>
> I gave this a quick try-out with the script I had from previous
> versions,
> and found these two errors:
>
> ------------
> drop schema if exists schema1 cascade;
> create schema if not exists schema1;
> drop variable if exists schema1.myvar1; --> error 49
> create variable schema1.myvar1 as text ;
> select schema1.myvar1;
> let schema1.myvar1 = 'variable value ""';
> select schema1.myvar1;
> alter variable schema1.myvar1 rename to myvar2;
> select schema1.myvar2;
> create variable schema1.myvar1 as text ;
> let schema1.myvar1 = 'variable value ""';
> select schema1.myvar1;
> alter variable schema1.myvar1 rename to myvar2; --> error 4287
> select schema1.myvar2;
> ------------
>
>
> The above, ran with psql -qXa gives the following output:
>
> drop schema if exists schema1 cascade;
> create schema if not exists schema1;
> drop variable if exists schema1.myvar1; --> error 49
> ERROR: unrecognized object type: 49
> create variable schema1.myvar1 as text ;
> select schema1.myvar1;
> myvar1
> --------
>
> (1 row)
>
> let schema1.myvar1 = 'variable value ""';
> select schema1.myvar1;
> myvar1
> -------------------
> variable value ""
> (1 row)
>
> alter variable schema1.myvar1 rename to myvar2;
> select schema1.myvar2;
> myvar2
> -------------------
> variable value ""
> (1 row)
>
> create variable schema1.myvar1 as text ;
> let schema1.myvar1 = 'variable value ""';
> select schema1.myvar1;
> myvar1
> -------------------
> variable value ""
> (1 row)
>
> alter variable schema1.myvar1 rename to myvar2; --> error 4287
> ERROR: unsupported object class 4287
> select schema1.myvar2;
> myvar2
> -------------------
> variable value ""
> (1 row)
>
>
Should be fixed now.

Thank you for report

Pavel

>
> thanks,
>
>
> Erik Rijkers
>
>
>

Attachment Content-Type Size
schema-variables-20181231-02.patch.gz application/gzip 65.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Isaac Morland 2018-12-31 17:40:23 Re: Is MinMaxExpr really leakproof?
Previous Message Noah Misch 2018-12-31 17:29:22 pg_regress: promptly detect failed postmaster startup