Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aaO3I-0004pd-B8 for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Feb 2016 13:39:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aaO3H-00011u-6p for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Feb 2016 13:39:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aaO2c-00083B-Ot for pgsql-bugs@postgresql.org; Mon, 29 Feb 2016 13:39:14 +0000 Received: from [2600:3c02::f03c:91ff:fe70:c491] (helo=apinaye.timbira.com.br) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aaO2a-0006jH-0N for pgsql-bugs@postgresql.org; Mon, 29 Feb 2016 13:39:13 +0000 Received: by apinaye.timbira.com.br (Postfix, from userid 110) id 2E492173E02; Mon, 29 Feb 2016 10:39:11 -0300 (BRT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on apinaye X-Spam-Level: X-Spam-Status: No, score=-100.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,URIBL_BLOCKED,USER_IN_WHITELIST autolearn=no version=3.3.1 Received: from [10.3.2.21] (unknown [179.105.168.188]) by apinaye.timbira.com.br (Postfix) with ESMTPSA id 49426173E01; Mon, 29 Feb 2016 10:39:10 -0300 (BRT) Subject: Re: BUG #13993: Temp sequence does not seem to be properly deleted To: mathias.zajaczkowski@ubik.ch, pgsql-bugs@postgresql.org References: <20160228200812.10543.12731@wrigleys.postgresql.org> From: Euler Taveira Organization: Timbira Message-ID: <56D449FB.20604@timbira.com.br> Date: Mon, 29 Feb 2016 10:39:07 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160228200812.10543.12731@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2600:3c02::f03c:91ff:fe70:c491 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 <> 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