agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Jaime Casanova <jcasanov@systemguards.com.ec>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Erik Rijkers <er@xs4all.nl>
Cc: Gilles Darold <gilles@darold.net>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: Schema variables - new implementation for Postgres 15
Date: Sun, 12 Sep 2021 11:26:00 -0500
Message-ID: <20210912162600.GA7630@ahch-to> (raw)
In-Reply-To: <CAFj8pRA-y9aTVwYPuVcdLpeb1F5M4n_mDmz-eec3ipJsC79GeA@mail.gmail.com>
References: <CAFj8pRD5pdT+cSjCcckTiK0p_nqUBYuujbFQ=L-GCmgQUf4vTA@mail.gmail.com>
	<CAFj8pRBMxunPa7g3+w88FOJG8xrLN5wprfBe8euidQNPXjYKZQ@mail.gmail.com>
	<CAFj8pRBs4FY2AZftRHDyDXtPc7APku+3ZPdA+CKcjeLXR0u=vA@mail.gmail.com>
	<44b94969-5e95-6626-a241-d411c0f8e67d@darold.net>
	<CAFj8pRCQX+Cry7kN8CDGgpKF2Zmd_vNafzRb-9bhR8bgoZqpGA@mail.gmail.com>
	<CAFj8pRD5Hy8Os-hTtw7FSJrHDx3QW6ohKyM+R0DVCH-Fi1G8-A@mail.gmail.com>
	<b8c690e9-67f7-b017-fade-d3d0bb03f891@xs4all.nl>
	<CAFj8pRDfJ4nC7MV2jK=E63_9M7Bf6+qP1sSYYQuEekWpCzbMNA@mail.gmail.com>
	<20210912021338.GA21136@ahch-to>
	<CAFj8pRA-y9aTVwYPuVcdLpeb1F5M4n_mDmz-eec3ipJsC79GeA@mail.gmail.com>

On Sun, Sep 12, 2021 at 05:38:42PM +0200, Pavel Stehule wrote:
> Hi
> 
> > """
> > regression=# create temp variable random_number numeric on commit drop;
> > CREATE VARIABLE
> > regression=# \dV
> > Did not find any schema variables.
> > regression=# declare q cursor  for select 1;
> > ERROR:  DECLARE CURSOR can only be used in transaction blocks
> > """
> >
> 
> I have different result
> 
> postgres=# create temp variable random_number numeric on commit drop;
> CREATE VARIABLE
> postgres=# \dV
>                                              List of variables
> ┌────────┬───────────────┬─────────┬─────────────┬────────────┬─────────┬───────┬──────────────────────────┐
> │ Schema │     Name      │  Type   │ Is nullable │ Is mutable │ Default │
> Owner │ Transactional end action │
> ╞════════╪═══════════════╪═════════╪═════════════╪════════════╪═════════╪═══════╪══════════════════════════╡
> │ public │ random_number │ numeric │ t           │ t          │         │
> tom2  │                          │
> └────────┴───────────────┴─────────┴─────────────┴────────────┴─────────┴───────┴──────────────────────────┘
> (1 row)
> 
> 
> 

Hi, 

Thanks, will test rebased version.
BTW, that is not the temp variable. You can note it because of the
schema or the lack of a "Transaction end action". That is a normal
non-temp variable that has been created before. A TEMP variable with an
ON COMMIT DROP created outside an explicit transaction will disappear
immediatly like cursor does in the same situation.


-- 
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL





view thread (365+ messages)  latest in thread

Message-ID: <20210912162600.GA7630@ahch-to>
Permalink:  ../20210912162600.GA7630@ahch-to/
Also on:    postgresql.org/message-id/20210912162600.GA7630@ahch-to

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-hackers@postgresql.org
  Cc: jcasanov@systemguards.com.ec, pavel.stehule@gmail.com, er@xs4all.nl, gilles@darold.net, pgsql-hackers@lists.postgresql.org, michael@paquier.xyz, amit.kapila16@gmail.com, tomas.vondra@2ndquadrant.com, peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: Schema variables - new implementation for Postgres 15
  In-Reply-To: <20210912162600.GA7630@ahch-to>

* 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