On Tue, 2003-07-01 at 13:33, Tom Lane wrote:
> Erik Erkelens <[EMAIL PROTECTED]> writes:
> > DECLARE
> > new_max_records ALIAS FOR $1;
> > BEGIN
> > CREATE SEQUENCE my_sequence MAXVALUE new_max_records CYCLE;
>
> > ERROR: parser: parse error at or near "$1" at character 3
Erik Erkelens <[EMAIL PROTECTED]> writes:
> DECLARE
> new_max_records ALIAS FOR $1;
> BEGIN
> CREATE SEQUENCE my_sequence MAXVALUE new_max_records CYCLE;
> ERROR: parser: parse error at or near "$1" at character 39
You'll need to use EXECUTE to construct and execute that
On Mon, 30 Jun 2003, Erik Erkelens wrote:
> new_max_records ALIAS FOR $1;
> BEGIN
> DROP SEQUENCE my_sequence;
> --CREATE SEQUENCE my_sequence MAXVALUE 4
> CYCLE;
> CREATE SEQUENCE my_sequence MAXVALUE
> new_max_records CYCLE;
Most of the creates/drops/etc...
Hi,
I need a table to hold the last n INSERTs into it.
To keep track of how many entries there are, and to
provide a unique id to order the records in the table,
I use a sequence. A trigger function deletes and entry
on an insert if the table is full.
The number n maybe changed, so I implemen