Re: Best way to create a sequence generator at run time?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Leon Starr <leon_starr(at)modelint(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Best way to create a sequence generator at run time?
Date: 2010-09-21 21:56:58
Message-ID: 10253.1285106218@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Leon Starr <leon_starr(at)modelint(dot)com> writes:
> I presume that the create sequence expression wants to see literals instead of variables, right? I knew I was going to run into this situation sooner or later. What should I be doing here?

You need to construct the CREATE SEQUENCE command as a string then
EXECUTE it. CREATE SEQUENCE, like most other utility commands, doesn't
handle parameters well.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Leon Starr 2010-09-22 00:06:12 Re: Best way to create a sequence generator at run time?
Previous Message Jorge Alberto Fuentes Casillas 2010-09-21 21:28:05 Table transfer