Search Postgresql Archives

Alter Table Auto_Increment

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

 



I have a table in my database and would like to modify the one column
that is already configured to be the PRIMARY KEY but I forgot to set
it for AUTO_INCREMENT. For some reason I can't find what the proper
command would be in the documentation and my commands from MySQL don't
appear to work properly in PostgreSQL:


sun=# \d blades
            Table "public.blades"
  Column  |         Type          | Modifiers
----------+-----------------------+-----------
 id       | integer               | not null
 ilom_ip  | character varying(15) |
 host_os  | character varying(50) |
 host_ip  | character varying(15) |
 hostname | character varying(50) |
 serial   | character varying(30) |
 gfe      | character varying(10) |
 admin    | character varying(50) |
Indexes:
    "blades_pkey" PRIMARY KEY, btree (id)

My command is not working so I don't know what I am doing wrong:

sun=# ALTER TABLE blades MODIFY int AUTO_INCREMENT;
ERROR:  syntax error at or near "MODIFY"
LINE 1: ALTER TABLE blades MODIFY int AUTO_INCREMENT;

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