Search Postgresql Archives

data definition within plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

I tried this code (to be inserted within a larger psql script)

do $_$
declare
	next int;
begin
	select max(id) + 1 into next from items;
	execute 'create temp sequence tmp_ids start $1' using next;
end
$_$ language plpgsql;

but that reports a syntax error near $1.
What is the proper way of doing that?

Best regards
Wolfgang Hamann





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux