public inbox for pgsql-performance@postgresql.org  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: srielau <serge@rielau.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: proposal: schema variables
Date: Tue, 31 Oct 2017 21:33:35 +0100
Message-ID: <CAFj8pRC3jq38zpNRJjQepkQKogfKC=0teb4OviZ7RwZ4je8ymQ@mail.gmail.com> (raw)
In-Reply-To: <1509399760322-0.post@n3.nabble.com>
References: <CAFj8pRDY+m9OOxfO10R7J0PAkCCauM-TweaTrdsrsLGMb1VbEQ@mail.gmail.com>
	<20171026220732.GI4496@localhost>
	<CAFj8pRAemkdaDuoRQzrhs2GU59Bb_yHuquJC6nyrwGHfVdLuLw@mail.gmail.com>
	<1509399760322-0.post@n3.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Hi

2017-10-30 22:42 GMT+01:00 srielau <serge@rielau.com>:

> Pavel,
>
> I wouldn't put in the DROP option.
> Or at least not in that form of syntax.
>
> By convention CREATE persists DDL and makes object definitions visible
> across sessions.
> DECLARE defines session private objects which cannot collide with other
> sessions.
>
> If you want variables with a short lifetime that get dropped at the end of
> the transaction that by definition would imply a session private object. So
> it ought to be DECLARE'd.
>
> As far as I can see PG has been following this practice so far.
>

I am thinking so there is little bit overlap between DECLARE and CREATE
TEMP VARIABLE command. With DECLARE command, you are usually has not any
control when variable will be destroyed. For CREATE TEMP xxxx is DROP IF
EXISTS, but it should not be used.

It should be very similar to our current temporary tables, that are created
in session related temp schema.

I can imagine, so DECLARE command will be introduced as short cut for
CREATE TEMP VARIABLE, but in this moment I would not to open this topic. I
afraid of bikeshedding and I hope so CREATE TEMP VAR is anough.

Regards

Pavel


> Cheers
> Serge Rielau
> Salesforce.com
>
>
>
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-
> f1928748.html
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pavel.stehule@gmail.com, serge@rielau.com, pgsql-hackers@postgresql.org
  Subject: Re: proposal: schema variables
  In-Reply-To: <CAFj8pRC3jq38zpNRJjQepkQKogfKC=0teb4OviZ7RwZ4je8ymQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox