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 12:57 PM, Carlos Mennens
<carlos.mennens@xxxxxxxxx> wrote:
> On Tue, May 17, 2011 at 12:38 PM, Raymond O'Donnell <rod@xxxxxx> wrote:
>> Yes, that's exactly right - SERIAL does it all for you. The mistake some
>> people make, on the other hand, is thinking that SERIAL is a type in its own
>> right - it's not, it just does all those steps automatically.

So if I have an existing column in my table with a INT data type, I
can't seem to understand how to convert this on my 8.4 production
server:

ALTER TABLE users ALTER COLUMN id TYPE SERIAL;
ERROR:  type "serial" does not exist

I verified from the docs that 8.4 does support SERIAL but how I
convert this data type, I can't seem to figure out. Below is my table
definition:

orlando=# \d users
            Table "public.users"
 Column |         Type          | Modifiers
--------+-----------------------+-----------
 id     | integer               | not null
 fname  | character varying(40) | not null
 lname  | character varying(40) | not null
 email  | character varying(40) | not null
 office | character varying(5)  | not null
 dob    | date                  | not null
 title  | character varying(40) | not null
Indexes:
    "users_pkey" PRIMARY KEY, btree (id)
    "users_email_key" UNIQUE, btree (email)

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