postgresql/src/test
Tom Lane ecb533af62 Further fix dumping of views that contain just VALUES(...).
It turns out that commit e9f1c01b7 missed a case: we must print a
VALUES clause in long format if get_query_def is given a resultDesc
that would require the query's output column name(s) to be different
from what the bare VALUES clause would produce.

This applies in case an ALTER ... RENAME COLUMN has been done to
a view that formerly could be printed in simple format, as shown
in the added regression test case.  It also explains bug #16119
from Dmitry Telpt, because it turns out that (unlike CREATE VIEW)
CREATE MATERIALIZED VIEW fails to apply any column aliases it's
given to the stored ON SELECT rule.  So to get them to be printed,
we have to account for the resultDesc renaming.  It might be worth
changing the matview code so that it creates the ON SELECT rule
with the correct aliases; but we'd still need these messy checks in
get_simple_values_rte to handle the case of a subsequent column
rename, so any such change would be just neatnik-ism not a bug fix.

Like the previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16119-e64823f30a45a754@postgresql.org
2019-11-16 20:00:20 -05:00
..
examples Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
isolation Fix predicate-locking of HOT updated rows. 2019-08-07 12:41:31 +03:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:54:52 -08:00
mb Revert "Fix broken multibyte regression tests." 2016-01-26 09:00:33 +09:00
modules Solve cross-version-upgrade testing problem induced by 1fb57af92. 2019-02-09 21:02:06 -05:00
perl Fix old TAP tests' method for selecting a valid PGPORT value. 2018-11-19 20:01:35 -05:00
regress Further fix dumping of views that contain just VALUES(...). 2019-11-16 20:00:20 -05:00
ssl Fix searchpath and module location for pg_rewind and ssl TAP tests 2019-02-07 11:10:59 -05:00
thread Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00