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

Поиск
Список
Период
Сортировка
От Alexander Farber
Тема alter table add column - specify where the column will go?
Дата
Msg-id AANLkTi=V+R7BK0DQ0Y8ObT-u-QhZp2umK3i0Lv7+73mm@mail.gmail.com
обсуждение исходный текст
Ответы Re: alter table add column - specify where the column will go?  (Szymon Guz <mabewlun@gmail.com>)
Re: alter table add column - specify where the column will go?  (Thomas Kellerer <spam_eater@gmx.net>)
Re: alter table add column - specify where the column will go?  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: c k
Дата:
Сообщение: Re: plpyhton
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: alter table add column - specify where the column will go?