Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA1II-0000PO-Ei for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2017 22:15:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eA1IH-0003er-Ew for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2017 22:15: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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eA1Gj-0000pf-Nh for pgsql-hackers@postgresql.org; Wed, 01 Nov 2017 22:13:53 +0000 Received: from mimolette.dalibo.net ([212.85.157.144] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eA1Gf-0005iZ-0N for pgsql-hackers@postgresql.org; Wed, 01 Nov 2017 22:13:53 +0000 Received: from [192.168.0.107] (unknown [176.167.240.214]) by mail.dalibo.com (Postfix) with ESMTPSA id 9F41D2C06BE; Wed, 1 Nov 2017 23:13:47 +0100 (CET) Subject: Re: proposal: schema variables To: Pavel Stehule Cc: PostgreSQL Hackers References: <20171026220732.GI4496@localhost> <1509399760322-0.post@n3.nabble.com> <5665be80-1772-4998-8dbc-3bd071c0d9ad@rielau.com> <1509485317393-0.post@n3.nabble.com> From: Gilles Darold Message-ID: Date: Wed, 1 Nov 2017 23:13:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------CB2316872747386A52B5D82E" Content-Language: en-US List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------CB2316872747386A52B5D82E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 01/11/2017 =C3=A0 05:15, Pavel Stehule a =C3=A9crit=C2=A0: > > > 2017-10-31 22:28 GMT+01:00 srielau >: > > Pavel, > > There is no > DECLARE TEMP CURSOR > or > DECLARE TEMP variable in PLpgSQL > and > > > sure .. DECLARE TEMP has no sense, I talked about similarity DECLARE > and CREATE TEMP > > > CREATE TEMP TABLE has a different meaning from what I understand yo= u > envision for variables. > > But maybe I'm mistaken. Your original post did not describe the ent= ire > syntax: > CREATE [TEMP] VARIABLE [IF NOT EXISTS] name AS type > =C2=A0 [ DEFAULT expression ] [[NOT] NULL] > =C2=A0 [ ON TRANSACTION END { RESET | DROP } ] > =C2=A0 [ { VOLATILE | STABLE } ]; > > Especially the TEMP is not spelled out and how its presence affects= or > doesn't ON TRANSACTION END. > So may be if you elaborate I understand where you are coming from. > > > TEMP has same functionality (and implementation) like our temp tables > - so at session end the temp variables are destroyed, but it can be > assigned to transaction. Oh ok, I understand thanks for the precision. --=20 Gilles Darold Consultant PostgreSQL http://dalibo.com - http://dalibo.org --------------CB2316872747386A52B5D82E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Le 01/11/2017 à 05:15, Pavel Stehule a écrit :


2017-10-31 22:28 GMT+01:00 srielau <serge@rielau.com>:
Pavel,

There is no
DECLARE TEMP CURSOR
or
DECLARE TEMP variable in PLpgSQL
and

sure .. DECLARE TEMP has no sense, I talked about similarity DECLARE and CREATE TEMP


CREATE TEMP TABLE has a different meaning from what I understand you
envision for variables.

But maybe I'm mistaken. Your original post did not describe the entire
syntax:
CREATE [TEMP] VARIABLE [IF NOT EXISTS] name AS type
  [ DEFAULT expression ] [[NOT] NULL]
  [ ON TRANSACTION END { RESET | DROP } ]
  [ { VOLATILE | STABLE } ];

Especially the TEMP is not spelled out and how its presence affects or
doesn't ON TRANSACTION END.
So may be if you elaborate I understand where you are coming from.

TEMP has same functionality (and implementation) like our temp tables - so at session end the temp variables are destroyed, but it can be assigned to transaction.

Oh ok, I understand thanks for the precision.

-- 
Gilles Darold
Consultant PostgreSQL
http://dalibo.com - http://dalibo.org
--------------CB2316872747386A52B5D82E--