Re: Switching Primary Keys to BigInt
От | Adrian Klaver |
---|---|
Тема | Re: Switching Primary Keys to BigInt |
Дата | |
Msg-id | c996f5f0-6385-20f0-a43d-9915d8d6e5ba@aklaver.com обсуждение исходный текст |
Ответ на | Re: Switching Primary Keys to BigInt (Adrian Klaver <adrian.klaver@aklaver.com>) |
Список | pgsql-general |
On 7/21/20 11:17 AM, Adrian Klaver wrote: > On 7/21/20 8:30 AM, Mohamed Wael Khobalatte wrote: >> Hi all, > > test_(aklaver)5432> alter table change_seq alter COLUMN id set data type > bigint; > ALTER TABLE > test_(aklaver)5432> \d change_seq > Table "public.change_seq" > Column | Type | Collation | Nullable | Default > --------+--------+-----------+----------+---------------------------------------- > > id | bigint | | not null | > nextval('change_seq_id_seq'::regclass) > Indexes: > "change_seq_pkey" PRIMARY KEY, btree (id) Forgot sequences are bigint by default. It would not hurt to check pg_sequence just to make sure they are that. In that case the below is not needed. > > test_(aklaver)5432> alter sequence change_seq_id_seq as bigint; > ALTER SEQUENCE > >> -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: