Search Postgresql Archives

Re: Remove Modifiers on Table

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

 



On Tue, May 17, 2011 at 2:32 PM, Susan Cassidy <scassidy@xxxxxxxxxxxx> wrote:
> Don't forget to use setval to set the current value of the sequence to the highest number used in the data already, so that the next insertion uses a new, unused value.

Doesn't the SERIAL shortcut automatically do this on the fly? How
would I set this?

ALTER TABLE table_name ALTER COLUMN id SET DEFAULT nextval('foo_seq_id');

?

On Tue, May 17, 2011 at 2:33 PM, Adrian Klaver <adrian.klaver@xxxxxxxxx> wrote:
> It will work for an existing table if you are adding a column with 'type'
> SERIAL. You just cannot change an existing column to 'type' SERIAL.

Yup,

That's what I meant to say in a more clear and function statement ;)

-- 
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