BUG #15685: pg_upgrade fails to migrate DEFAULT values that use custom TYPEs or FUNCTIONs

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: justusgraf(at)gmx(dot)de
Subject: BUG #15685: pg_upgrade fails to migrate DEFAULT values that use custom TYPEs or FUNCTIONs
Date: 2019-03-11 08:49:47
Message-ID: 15685-5eb648134f5ec0b7@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15685
Logged by: Justus Graf
Email address: justusgraf(at)gmx(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2019-03-11 09:23:32 Re: BUG #15679: Partial HASH index takes too much space
Previous Message Michael Paquier 2019-03-11 07:21:14 Re: BUG #15668: Server crash in transformPartitionRangeBounds