Re: proposal: schema variables

From: srielau <serge(at)rielau(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal: schema variables
Date: 2017-10-30 21:42:40
Message-ID: 1509399760322-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

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.

Cheers
Serge Rielau
Salesforce.com

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-10-30 21:43:54 Re: Re: PANIC: invalid index offnum: 186 when processing BRIN indexes in VACUUM
Previous Message Lætitia Avrot 2017-10-30 21:13:43 Adding column_constraint description in ALTER TABLE synopsis

Browse pgsql-performance by date

  From Date Subject
Next Message patibandlakoshal 2017-10-30 22:51:06 Cursor vs Set Operation
Previous Message Tom Lane 2017-10-29 14:58:00 Re: Cheaper subquery scan not considered unless offset 0