postgresql/src
Tomas Vondra ebb4caa912 Improve the check for pg_catalog.line data type in pg_upgrade
The pg_upgrade check for pg_catalog.line data type when upgrading from
9.3 had a couple of issues with domains and composite types. Firstly, it
triggered false positives for composite types unused in objects with
storage. This was enough to trigger an unnecessary pg_upgrade failure:

  CREATE TYPE line_composite AS (l pg_catalog.line)

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

  CREATE DOMAIN line_domain AS pg_catalog.line;
  CREATE TYPE line_composite_2 AS (l line_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.line data type through a domain. So we missed cases like this

  CREATE TABLE t (l line_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. 9.3 did not
support domains on composite types, but we can still have multi-level
composite types.

Backpatch all the way to 9.4, where the format for pg_catalog.line data
type changed.

Author: Tomas Vondra
Backpatch-to: 9.4-
Discussion: https://postgr.es/m/16045-673e8fa6b5ace196%40postgresql.org
2019-10-16 13:25:25 +02:00
..
backend Fix CLUSTER on expression indexes. 2019-10-15 10:40:51 -07:00
bin Improve the check for pg_catalog.line data type in pg_upgrade 2019-10-16 13:25:25 +02:00
common In pg_log_generic(), be more paranoid about preserving errno. 2019-07-06 11:25:48 -04:00
fe_utils Update stale comments, and fix comment typos. 2019-06-08 10:12:26 -07:00
include Fix crash caused by EPQ happening with a before update trigger present. 2019-10-04 13:57:37 -07:00
interfaces Put back pqsignal() as an exported libpq symbol. 2019-10-10 14:24:57 -04:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:39 -07:00
pl Translation updates 2019-09-29 23:57:17 +02:00
port Improve what pg_strsignal prints if we haven't got strsignal(3). 2019-08-27 17:24:30 -04:00
template AIX: Stop adding option -qsrcmsg. 2019-10-12 00:21:50 -07:00
test Replace alter_table.sql test usage of event triggers. 2019-10-16 02:38:13 -07:00
timezone Update time zone data files to tzdata release 2019c. 2019-09-20 19:53:52 -04:00
tools Handle spaces in OpenSSL install location for MSVC 2019-10-04 15:39:27 -04:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Consistently test for in-use shared memory. 2019-04-12 22:36:38 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:05:50 +02:00