How to migrate column type from uuid to serial

From: Hemil Ruparel <hemilruparel2002(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: How to migrate column type from uuid to serial
Date: 2020-10-07 12:48:26
Message-ID: CANW1aT8fpZqpr6WcN1oj8-0PWjsgorPMEUQguUpO00E=bXYG2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2020-10-07 13:01:56 Re: What version specification used by PG community developers?
Previous Message Dmitry Igrishin 2020-10-07 10:53:44 Re: Which is the setup with lowest resources you know Postgres is used in?