https://github.com/postgres/postgres
Revision 749c7c41701c62d96a56af1531e4f51e39173be3 authored by Tom Lane on 09 August 2017, 21:03:09 UTC, committed by Tom Lane on 09 August 2017, 21:03:09 UTC
find_composite_type_dependencies correctly found columns that are of
the specified type, and columns that are of arrays of that type, but
not columns that are domains or ranges over the given type, its array
type, etc.  The most general way to handle this seems to be to assume
that any type that is directly dependent on the specified type can be
treated as a container type, and processed recursively (allowing us
to handle nested cases such as ranges over domains over arrays ...).
Since a type's array type already has such a dependency, we can drop
the existing special case for the array type.

The very similar logic in get_rels_with_domain was likewise a few
bricks shy of a load, as it supposed that a directly dependent type
could *only* be a sub-domain.  This is already wrong for ranges over
domains, and it'll someday be wrong for arrays over domains.

Add test cases illustrating the problems, and back-patch to all
supported branches.

Discussion: https://postgr.es/m/15268.1502309024@sss.pgh.pa.us
1 parent a76200d
History
Tip revision: 749c7c41701c62d96a56af1531e4f51e39173be3 authored by Tom Lane on 09 August 2017, 21:03:09 UTC
Fix handling of container types in find_composite_type_dependencies.
Tip revision: 749c7c4
File Mode Size
config
contrib
doc
src
.dir-locals.el -rw-r--r-- 738 bytes
.gitattributes -rw-r--r-- 1.6 KB
.gitignore -rw-r--r-- 478 bytes
COPYRIGHT -rw-r--r-- 1.2 KB
GNUmakefile.in -rw-r--r-- 3.6 KB
HISTORY -rw-r--r-- 284 bytes
Makefile -rw-r--r-- 1.5 KB
README -rw-r--r-- 1.2 KB
README.git -rw-r--r-- 728 bytes
aclocal.m4 -rw-r--r-- 457 bytes
configure -rwxr-xr-x 485.4 KB
configure.in -rw-r--r-- 75.6 KB

README

back to top