pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Mamin <M.Mamin@intershop.de>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: removing "serial" from table definitions.
Date: Thu, 24 Jun 2021 12:33:03 +0000
Message-ID: <feaeb83188034e9e88fcaeb33225b22c@intershop.de> (raw)

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

view thread (6+ messages)  latest in thread

Message-ID: <feaeb83188034e9e88fcaeb33225b22c@intershop.de>
Permalink:  ../feaeb83188034e9e88fcaeb33225b22c@intershop.de/
Also on:    postgresql.org/message-id/feaeb83188034e9e88fcaeb33225b22c@intershop.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: M.Mamin@intershop.de
  Subject: Re: removing "serial" from table definitions.
  In-Reply-To: <feaeb83188034e9e88fcaeb33225b22c@intershop.de>
  References: <feaeb83188034e9e88fcaeb33225b22c@intershop.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox