Re: [SQL] How to Convert Integer to Serial - Mailing list pgsql-general

From venkat
Subject Re: [SQL] How to Convert Integer to Serial
Date
Msg-id AANLkTin-oCkRSxgBSg9aA80aNJY0BfXtjA3NswReDyYy@mail.gmail.com
Whole thread Raw
In response to Re: [SQL] How to Convert Integer to Serial  (Shoaib Mir <shoaibmir@gmail.com>)
List pgsql-general
Yes Done... Thanks alot...

On Fri, Oct 29, 2010 at 10:40 AM, Shoaib Mir <shoaibmir@gmail.com> wrote:
On Fri, Oct 29, 2010 at 4:05 PM, venkat <ven.tammineni@gmail.com> wrote:
ALTER TABLE Demotable ALTER COLUMN gid 
        SET DEFAULT nextval('serial'::regclass);


It is saying that ..serial does not exist...is that true ?



Please avoid sending emails to the personal email addresses but use the community mailing lists for that.

For the error you mentioned please follow the steps I mentioned in my last email as you are doing it the wrong way. 

Create a sequence first and then you can assign that sequence to this column. You can not assign SERIAL like this, it has to be a sequence name in there.  

pgsql-general by date:

Previous
From: Shoaib Mir
Date:
Subject: Re: [SQL] How to Convert Integer to Serial
Next
From: Alban Hertroys
Date:
Subject: Re: share lock when only one user connected?