Search Postgresql Archives

Re: alter table add column - specify where the column will go?

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

 





On 24 November 2010 08:42, Alexander Farber <alexander.farber@xxxxxxxxx> wrote:
Hello,

is there a syntax to add a column not at the last place, but
somewhere inbetween or do I have to dump/restore the table?

For example if I'd like to add last_logout right after last_login:

Â\d pref_users;
       ÂTable "public.pref_users"
 Column  |      ÂType       |  Modifiers
------------+-----------------------------+---------------
Âid     | character varying(32)    | not null
Âfirst_name | character varying(32) Â Â Â |
Âlast_name Â| character varying(32) Â Â Â |
Âfemale   | boolean           |
Âavatar   | character varying(128)   Â|
Âcity    | character varying(32)    |
Âlat    Â| real            Â|
Âlng    Â| real            Â|
Âlast_login | timestamp without time zone | default now()
Âlast_ip  Â| inet            Â|
Âmedals   | smallint          Â| default 0

Thank you
Alex


.... no

Why do you want to do anything like that?Â


regards
Szymon Guz

[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