Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdzg8-0002l8-Cc for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Dec 2018 15:40:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gdzg5-00011k-L7 for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Dec 2018 15:40:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdzg5-0000xt-De for pgsql-hackers@lists.postgresql.org; Mon, 31 Dec 2018 15:40:29 +0000 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gdzg2-0003Mv-US for pgsql-hackers@lists.postgresql.org; Mon, 31 Dec 2018 15:40:28 +0000 Received: from webmailclassic.xs4all.nl ([IPv6:2001:888:0:22:194:109:20:199]) by smtp-cloud7.xs4all.net with ESMTPA id dzg0gAnaCPX6idzg0g07em; Mon, 31 Dec 2018 16:40:25 +0100 Received: from 2001:983:39b6:1:ca5:768c:656a:770c by webmailclassic.xs4all.nl with HTTP (HTTP/1.1 POST); Mon, 31 Dec 2018 16:40:24 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 31 Dec 2018 16:40:24 +0100 From: Erik Rijkers To: Pavel Stehule Cc: Artur Zakirov , Dean Rasheed , Fabien COELHO , Gilles Darold , PostgreSQL Hackers Subject: Re: [HACKERS] proposal: schema variables In-Reply-To: References: <20180919112305.GA18604@zakirov.localdomain> Message-ID: X-Sender: er@xs4all.nl User-Agent: XS4ALL Webmail X-CMAE-Envelope: MS4wfP5HjoecgmTBFzdnDB8x4fp9JTFS2zE1Z6aYtLjGoAS1WZMQAUFMcCZcQPh8fmiVGMVXi+lllWp5gEMLvXSuqfZnSVQKiY78K5JHjVoQrFes+3Mv9z7i nBN4HtkEHncpXpCRqUpvd1Ns8zZWJHU/20Lm8tsQxgv10CKz2YdTBqcCUQ5gtwwLKHFKZEkfgKAtdMgSC8Bt2zAyo/TUYXNddIXHeC7L5anupdrf0JdWY+Dz 6tHwhUL5Ior9WyLw/zz1t1vROg/7uezafRJQroi/t311bK1ayT3xLH4NiZN+kbHwQ22BRGyNmpo8Zjezdq/BRJG+o6LVP6n5DrHOihwMpRZPol0l2EjnxvGB U+Ie0Tnd4wzlgofPHSJcHjxirDCxQH3JYQuFoRD677Jc4eoYbDnWLzNPT0ksvhihbYj9LxY6 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-12-31 14:23, Pavel Stehule wrote: > st 21. 11. 2018 v 8:24 odesílatel Pavel Stehule > > [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) thanks, Erik Rijkers