Re: [NOVICE] alter existing table column with primary key to auto-increment

Поиск
Список
Период
Сортировка
От Rounak Jain
Тема Re: [NOVICE] alter existing table column with primary key to auto-increment
Дата
Msg-id CANNuxWN4eLxuO10tA60e6ynra8o+Xz1fpNVXySzRhNdE6KpyFw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [NOVICE] alter existing table column with primary key to auto-increment  (Rounak Jain <rounakjainis@gmail.com>)
Список pgsql-novice
yes, thanks for the help, martin.
create sequence product_id_seq;
alter table product alter column id set default nextval('product_id_seq');
alter sequence product_id_seq owned by product.id;

On Fri, Feb 17, 2017 at 9:17 PM, Martin Steer <martinsteer@maxi.net.au> wrote:
On Sun, Feb 05, 2017 at 04:27:44PM +0530, Rounak Jain wrote:
alter table customer add column id serial primary key;
I want to know how to alter the column instead of dropping it.

Consult the online help:

\h alter

\h alter table

\h alter sequence

M.


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

Предыдущее
От: neha khatri
Дата:
Сообщение: Re: [NOVICE] Regression test : pg_conversion validation
Следующее
От: KARIN SUSANNE HILBERT
Дата:
Сообщение: [NOVICE] Create PostgreSQL Database with ENCODING 'WIN1252' onCluster Initialized with locale "en_US.UTF-8"?