Re: Switching Primary Keys to BigInt
От | Mohamed Wael Khobalatte |
---|---|
Тема | Re: Switching Primary Keys to BigInt |
Дата | |
Msg-id | CABZeWdwsaMvjU7ECLKpAr5WZVp+5LS7NAcqhzg1KHkFHQQr1xQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Switching Primary Keys to BigInt (Michael Lewis <mlewis@entrata.com>) |
Ответы |
Re: Switching Primary Keys to BigInt
Re: Switching Primary Keys to BigInt |
Список | pgsql-general |
> > 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)
This is significant downtime, since it locks exclusively, no? We want to avoid that.
> Side note- EOL for 9.6 is coming next year so just a plug for upgrading when possible, perhaps utilizing pglogical to get to v11 or 12.
Yep, we are painfully aware. The id growth will beat us to it, so we need to deal with that first.
> 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)
This is significant downtime, since it locks exclusively, no? We want to avoid that.
> Side note- EOL for 9.6 is coming next year so just a plug for upgrading when possible, perhaps utilizing pglogical to get to v11 or 12.
Yep, we are painfully aware. The id growth will beat us to it, so we need to deal with that first.
В списке pgsql-general по дате отправления: