removing "serial" from table definitions.

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: removing "serial" from table definitions.
Date: 2021-06-24 12:33:03
Message-ID: feaeb83188034e9e88fcaeb33225b22c@intershop.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
Is there a way to change a data type from serial to int?
I tried with :
ALTER TABLE "admin".db_jobs ALTER COLUMN id TYPE int USING id::int;
But this seems not to change anything, as if Posgres woud consider the statement as a no-op.

My problem is that "serial" is not exported with pg_dump.
Creating a db from the dump will hence result into a different table definition (which is equivalent tough)

We are trying a transfer/migration tool on Azure, that check the table definitions between the source and target before starting the data transfer, and it blocks on that difference.

best regards,
Marc Mamin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johannes Paul 2021-06-24 12:42:37 Re: removing "serial" from table definitions.
Previous Message Vijaykumar Jain 2021-06-24 11:06:46 Re: Postgres PANIC when it could not open file in pg_logical/snapshots directory