postgresql/src/backend
Tom Lane 4d4c66addf Disallow changing an inherited column's type if not all parents changed.
If a table inherits from multiple unrelated parents, we must disallow
changing the type of a column inherited from multiple such parents, else
it would be out of step with the other parents.  However, it's possible
for the column to ultimately be inherited from just one common ancestor,
in which case a change starting from that ancestor should still be
allowed.  (I would not be excited about preserving that option, were
it not that we have regression test cases exercising it already ...)

It's slightly annoying that this patch looks different from the logic
with the same end goal in renameatt(), and more annoying that it
requires an extra syscache lookup to make the test.  However, the
recursion logic is quite different in the two functions, and a
back-patched bug fix is no place to be trying to unify them.

Per report from Manuel Rigger.  Back-patch to 9.5.  The bug exists in
9.4 too (and doubtless much further back); but the way the recursion
is done in 9.4 is a good bit different, so that substantial refactoring
would be needed to fix it in 9.4.  I'm disinclined to do that, or risk
introducing new bugs, for a bug that has escaped notice for this long.

Discussion: https://postgr.es/m/CA+u7OA4qogDv9rz1HAb-ADxttXYPqQdUdPY_yd4kCzywNxRQXA@mail.gmail.com
2019-08-18 17:11:57 -04:00
..
access Remove fmgr.h includes from headers that don't really need it. 2019-08-16 10:35:31 -07:00
bootstrap Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
catalog Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
commands Disallow changing an inherited column's type if not all parents changed. 2019-08-18 17:11:57 -04:00
executor Don't include utils/array.h from acl.h. 2019-08-16 10:33:30 -07:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Avoid macro clash with LLVM 9. 2019-07-29 10:23:55 +12:00
lib Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
libpq Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
main initdb: Remove obsolete locale handling 2019-08-14 06:51:13 +02:00
nodes Remove fmgr.h includes from headers that don't really need it. 2019-08-16 10:35:31 -07:00
optimizer Remove useless bms_free() calls in build_child_join_rel(). 2019-08-16 14:35:55 +09:00
parser Rationalize use of list_concat + list_copy combinations. 2019-08-12 11:20:18 -04:00
partitioning Don't include utils/array.h from acl.h. 2019-08-16 10:33:30 -07:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
postmaster Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
regex Fix inconsistencies and typos in the tree, take 9 2019-08-05 12:14:58 +09:00
replication Remove fmgr.h includes from headers that don't really need it. 2019-08-16 10:35:31 -07:00
rewrite Rationalize use of list_concat + list_copy combinations. 2019-08-12 11:20:18 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream 2019-07-04 13:26:48 +02:00
statistics Don't include utils/array.h from acl.h. 2019-08-16 10:33:30 -07:00
storage Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
tcop Revert "Add log_statement_sample_rate parameter" 2019-08-04 23:38:27 +02:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Add default_table_access_method to postgresql.conf.sample. 2019-08-16 15:24:22 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00