altering a table to set serial function

From: Prabu Subroto <prabu_subroto(at)yahoo(dot)com>
To: Postgres General Milis <pgsql-general(at)postgresql(dot)org>
Subject: altering a table to set serial function
Date: 2004-07-27 17:16:11
Message-ID: 20040727171611.43604.qmail@web41804.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear my friends...

I am using postgres 7.4 and SuSE 9.1.

I want to use auto_increment as on MySQL. I look up
the documentation on www.postgres.com and I found
"serial" .

But I don't know how to create auto_increment.
here is my try:
"
kv=# alter table sales alter column salesid int4
serial;
ERROR: syntax error at or near "int4" at character 40
"

Please tell me the correct command to that.

Thank you very much in advance.


__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

Responses

Browse pgsql-general by date

  From Date Subject
Next Message =?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?= 2004-07-27 18:55:39 tablename type?
Previous Message Jeff Davis 2004-07-27 17:12:13 Re: Trigger on Postgres for tables syncronization