postgresql/src/bin
Tomas Vondra d071a2539f Improve the check for pg_catalog.unknown data type in pg_upgrade
The pg_upgrade check for pg_catalog.unknown type when upgrading from 9.6
had a couple of issues with domains and composite types - it detected
even composite types unused in objects with storage. So for example this
was enough to trigger an unnecessary pg_upgrade failure:

  CREATE TYPE unknown_composite AS (u pg_catalog.unknown)

On the other hand, this only happened with composite types directly on
the pg_catalog.unknown data type, but not with a domain. So this was not
detected

  CREATE DOMAIN unknown_domain AS pg_catalog.unknown;
  CREATE TYPE unknown_composite_2 AS (u unknown_domain);

unlike the first example. These false positives and inconsistencies are
unfortunate, but what's worse we've failed to detected objects using the
pg_catalog.unknown type through a domain. So we missed cases like this

  CREATE TABLE t (u unknown_composite_2);

The consequence is clusters broken after a pg_upgrade.

This fixes these false positives and false negatives by using the same
recursive CTE introduced by eaf900e842 for sql_identifier. Backpatch all
the way to 10, where the of pg_catalog.unknown data type was restricted.

Author: Tomas Vondra
Backpatch-to: 10-
Discussion: https://postgr.es/m/16045-673e8fa6b5ace196%40postgresql.org
2019-10-16 13:26:26 +02:00
..
initdb Translation updates 2019-08-05 15:50:23 +02:00
pg_archivecleanup Translation updates 2019-05-06 15:00:30 +02:00
pg_basebackup Delay fsyncs of pg_basebackup until the end of backup 2019-09-04 13:24:06 +09:00
pg_config Translation updates 2019-05-06 15:00:30 +02:00
pg_controldata Translation updates 2019-05-06 15:00:30 +02:00
pg_ctl Translation updates 2019-08-05 15:50:23 +02:00
pg_dump Adjust to latest Msys2 kernel release number 2019-08-26 08:22:32 -04:00
pg_resetwal Translation updates 2019-08-05 15:50:23 +02:00
pg_rewind Disable timeouts when running pg_rewind with online source cluster 2019-08-28 11:48:19 +09:00
pg_test_fsync Translation updates 2019-05-06 15:00:30 +02:00
pg_test_timing Translation updates 2019-05-06 15:00:30 +02:00
pg_upgrade Improve the check for pg_catalog.unknown data type in pg_upgrade 2019-10-16 13:26:26 +02:00
pg_verify_checksums Translation updates 2019-08-05 15:50:23 +02:00
pg_waldump Avoid use of wildcard in pg_waldump's .gitignore. 2019-10-05 12:26:55 -04:00
pgbench Fix possible lockup in pgbench with -R. 2019-07-26 15:17:03 -04:00
pgevent Update copyright for 2018 2018-01-02 23:30:12 -05:00
psql Handle corner cases correctly in psql's reconnection logic. 2019-09-02 14:02:46 -04:00
scripts Fix failure of --jobs with vacuumdb on Windows 2019-08-27 09:11:43 +09:00
Makefile Allow on-line enabling and disabling of data checksums 2018-04-05 22:04:48 +02:00