Add quto increment to existing column - Mailing list pgsql-general

From Robert Buckley
Subject Add quto increment to existing column
Date
Msg-id 1317708841.25240.YahooMailNeo@web24103.mail.ird.yahoo.com
Whole thread Raw
Responses Re: Add quto increment to existing column  (marc_firth <marc.r.firth@gmail.com>)
Re: Add quto increment to existing column  (Greg Williamson <gwilliamson39@yahoo.com>)
List pgsql-general
Hi,

I have a column in a table called hist_id with the datatype "integer". When I created the table I assigned this column the primary key constraint but didn´t make it an auto-increment column.

How could I do this to an the already existing column?

I have created the sequence with the following command but don´t know how to change the existing column to auto-increment.


$ create sequence hist_id_seq;

thanks for any help,

Rob



pgsql-general by date:

Previous
From: senthilnathan
Date:
Subject: PG Source Compilation (Optional Features / Optional Packages)
Next
From: DUPREZ Cédric
Date:
Subject: Re: Problem with pg_upgrade from 9.0 to 9.1 under Ubuntu x64