Re: How to migrate column type from uuid to serial

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: How to migrate column type from uuid to serial
Дата
Msg-id e06aab47-151c-ea50-36bf-a34d68337f22@aklaver.com
обсуждение исходный текст
Ответ на How to migrate column type from uuid to serial  (Hemil Ruparel <hemilruparel2002@gmail.com>)
Список pgsql-general
On 10/7/20 5:48 AM, Hemil Ruparel wrote:
> I was integrating a payment gateway for my app when I noticed its 
> maximum length of customer id string is 32. SIze of UUID is 36 (32 
> characters and 4 dashes). So I want to change the type of customer id to 
> serial. The problem is by now, the column is being used at many places. 
> How to migrate the column to serial without dropping the data?

Changing the size of the column is not an option?

Your description of the customer id column above is somewhat confusing 
to me. Is the id actually stored as a UUID?

Why is the max length an issue?

If you where to migrate I would say create an independent 
serial/identity column. Then point the dependent objects at that. After 
all have been converted drop the old column.





-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: What version specification used by PG community developers?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to migrate column type from uuid to serial