pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: justusgraf@gmx.de
Subject: BUG #15685: pg_upgrade fails to migrate DEFAULT values that use custom TYPEs or FUNCTIONs
Date: Mon, 11 Mar 2019 08:49:47 +0000
Message-ID: <15685-5eb648134f5ec0b7@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15685
Logged by:          Justus Graf
Email address:      justusgraf@gmx.de
PostgreSQL version: 11.2
Operating system:   Debian GNU/Linux 9.8 (stretch)
Description:        

Hey there,

we've recently migrated from PostgreSQL 9.5 to 11.2 and after pg_upgrade a
couple of tables were in a "broken" state afterwards where they were lacking
DEFAULT values that relied on custom TYPEs or FUNCTIONs so that after the
upgrade, we needed to run migrations such as

ALTER TABLE IF EXISTS table1
    ALTER COLUMN column1 SET DEFAULT unix_timestamp()
ALTER TABLE IF EXISTS table2
    ALTER COLUMN column2 SET DEFAULT 'open'::recruitment_state

We did experience something similar when using pg_restore in the past, not
sure if that helps or if you could give us any hints how this can be
avoided?

Best,

Justus



view thread (2+ messages)  latest in thread

Message-ID: <15685-5eb648134f5ec0b7@postgresql.org>
Permalink:  ../15685-5eb648134f5ec0b7@postgresql.org/
Also on:    postgresql.org/message-id/15685-5eb648134f5ec0b7@postgresql.org

 · 

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-bugs@postgresql.org
  Cc: noreply@postgresql.org, justusgraf@gmx.de
  Subject: Re: BUG #15685: pg_upgrade fails to migrate DEFAULT values that use custom TYPEs or FUNCTIONs
  In-Reply-To: <15685-5eb648134f5ec0b7@postgresql.org>
  References: <15685-5eb648134f5ec0b7@postgresql.org>

* 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