Search Postgresql Archives

Re: resetting sequence to cur max value

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

 



Michael Fuhr <mike@xxxxxxxx> writes:
> On Tue, Dec 12, 2006 at 12:19:56PM -0500, Tom Lane wrote:
>> Usually you do something like
>>   select setval('seq_name', (select max(idcol) from table) + 1);
>> after loading data into the table.

> Is "+ 1" necessary with the two-parameter form of setval()?

Given the docs you quoted, no --- I was just too lazy to look up whether
it set is_called or not.  With the +1 you don't have to think ;-)

			regards, tom lane


[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