Re: temp sequence

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Sim Zacks" <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: temp sequence
Date: 2008-02-03 07:30:14
Message-ID: c2d9e70e0802022330h38916142ra2266b9b4764295e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 3, 2008 1:39 AM, Sim Zacks <sim(at)compulab(dot)co(dot)il> wrote:
> "PostgreSQL 8.2.4 on i386-pc-linux-gnu, compiled by GCC i386-pc-linux-gnu-gcc
> (GCC) 4.1.1 (Gentoo 4.1.1)"
>
> I am creating a temporary sequence in a function and it seems like it is not
> going away after the function finishes.
> The front end is in MS Access 2000 and I have a single connection. When I call
> the function once it works, when I call it a second time, it gives me an error
> that the sequence already exists. When I restart the application, I can call the
> function again.
>

create, and use the sequence through EXECUTE

EXECUTE 'create temp sequence seq1';
EXECUTE 'select nextval(' || quote_literal('seq') || ') ';

the same apply for all kind of temp objects, in 8.3 this no longer
will be an issue

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Paul Argudo 2008-02-03 08:49:44 Re: PostgreSQL Certification
Previous Message Sim Zacks 2008-02-03 06:39:21 temp sequence