Search Postgresql Archives

Re: alter sequence

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

 



On 2012-11-24, Peter Kroon <plakroon@xxxxxxxxx> wrote:
> --f46d04389321c8f47d04cf3c0f32
> Content-Type: text/plain; charset=ISO-8859-1
>
> ALTER SEQUENCE (select pg_get_serial_sequence('table', 'id')) RESTART WITH
> 1;

> The query fails:
> ALTER SEQUENCE (select pg_get_serial_sequence('table...
> it's because of the (

you can end-run this problem by using the (undocumented ?) function setval:

select pg_catalog.setval(pg_get_serial_sequence('table','id') ,1,false);

-- 
⚂⚃ 100% natural



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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