Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3NAn-0005Vo-3W for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Mar 2019 15:49:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3NAk-0003WY-Q8 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 Mar 2019 15:49:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3NAk-0003WL-K2 for pgsql-bugs@lists.postgresql.org; Mon, 11 Mar 2019 15:49:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3NAi-0007XQ-KO for pgsql-bugs@lists.postgresql.org; Mon, 11 Mar 2019 15:49:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2BFmtoI000448; Mon, 11 Mar 2019 11:48:55 -0400 From: Tom Lane To: justusgraf@gmx.de cc: pgsql-bugs@lists.postgresql.org 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> Comments: In-reply-to PG Bug reporting form message dated "Mon, 11 Mar 2019 08:49:47 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <446.1552319335.1@sss.pgh.pa.us> Date: Mon, 11 Mar 2019 11:48:55 -0400 Message-ID: <447.1552319335@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > 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 It's hard to say anything definitive without a lot more detail, but my guess is that this was triggered by the recent security-related changes to make pg_dump scripts run with restrictive search_path settings. Probably what happened is that the custom objects you were relying on contain non-schema-qualified references that fail with a restrictive search_path, so that they didn't restore into the new database. It's unclear though why that wouldn't have led to pg_upgrade failing altogether. regards, tom lane