Re: ALTER SEQUENCE ... RESTART WITH [variable] problem - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: ALTER SEQUENCE ... RESTART WITH [variable] problem
Date
Msg-id 20060522221239.GB64371@pervasive.com
Whole thread Raw
In response to Re: ALTER SEQUENCE ... RESTART WITH [variable] problem  ("Tomi NA" <hefest@gmail.com>)
List pgsql-general
On Sat, May 20, 2006 at 11:46:25AM +0200, Tomi NA wrote:
> On 5/20/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
>
> >Seems you can't use a variable there. Your choices are to build a
> >string and use EXECUTE, or just do:
> >
> >SELECT setval('sequence',value);
>
> The EXECUTE string solution did the job. Thank you very much, Martijn.

As an FYI, the function version would be faster, since it can cache the
plan. Though in this case it sounds like it doesn't matter one iota.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: background writer process (PID 1400) exited with exit code 0 -- repeatedly && incomplete startup packet
Next
From: "Florian G. Pflug"
Date:
Subject: Re: Let's make CPgAN!