pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@timbira.com.br>
To: mathias.zajaczkowski@ubik.ch
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #13993: Temp sequence does not seem to be properly deleted
Date: Mon, 29 Feb 2016 10:39:07 -0300
Message-ID: <56D449FB.20604@timbira.com.br> (raw)
In-Reply-To: <20160228200812.10543.12731@wrigleys.postgresql.org>
References: <20160228200812.10543.12731@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 28-02-2016 17:08, mathias.zajaczkowski@ubik.ch wrote:
> Within a script I created temporary sequence:
> CREATE TEMP SEQUENCE 'rateSeq' with S in uppercase to be used for rate table
> pk.
You can't use single quotes. Instead, use double quotes.

$ psql -q
euler=# create temp sequence 'rateSeq';
ERROR:  syntax error at or near "'rateSeq'"
LINE 1: create temp sequence 'rateSeq';
                             ^
euler=# create temp sequence "rateSeq";
euler=# select relname from pg_class where relname ~ 'rate';
 relname
---------
 rateSeq
(1 row)

> Next time script gave an error "relation rateseq already exists".
> I modified the creation of the sequence  to:
> CREATE TEMP SEQUENCE rateseq (all in lower case)
> Same error when running the script.
> I tried: DROP SEQUENCE rateseq
> Result: sequence <<rateseq>> does not exist.
>
Temporary relations can't be dropped in another session. However, the
temp sequence will gone away when you close the connection that created it.

If you want to run your script many times in the same session, make sure
you include a DROP SEQUENCE at the end of the script.


-- 
   Euler Taveira                   Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <56D449FB.20604@timbira.com.br>
Permalink:  ../56D449FB.20604@timbira.com.br/
Also on:    postgresql.org/message-id/56D449FB.20604@timbira.com.br

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: euler@timbira.com.br, mathias.zajaczkowski@ubik.ch
  Subject: Re: BUG #13993: Temp sequence does not seem to be properly deleted
  In-Reply-To: <56D449FB.20604@timbira.com.br>
  References: <20160228200812.10543.12731@wrigleys.postgresql.org> <56D449FB.20604@timbira.com.br>

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

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