Change Postgres primary key type from varchar to uuid and it's referenced by other tables Change Postgres primary key type from varchar to uuid and it's referenced by other tables postgresql postgresql

Change Postgres primary key type from varchar to uuid and it's referenced by other tables


You would definitely want to drop the foreign key constraint. I was surprised that you didn't have to drop the PK constraint or index for PostgreSQL to change the data type like that. I set up a test and it worked fine, just had to drop the FK first and then re-add it afterward.