I am trying to create or update a postgresql sequence with a variable
If I set the exact value when creating or updating a sequence, it works
like create sequence test minvalue 5 maxvalue 10 start 5;
but if I create some function that sets the min and maxvalue sequences, for example
CREATE OR REPLACE FUNCTION test(bigint, bigint)
RETURNS void AS
$BODY$
BEGIN
create sequence test minvalue $1 maxvalue $2 start $1;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
Makes mistakes
I am looking to find a way to put a variable when creating a sequence
who knows the way? please, help.
I just want to create a range of sequence
source
share