pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix handling of container types in find_composite_type_dependenc
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/749c7c41701c62d96a56af1531e4f51e39173be3

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e2e398473e3c425a8e84a592641acc0db7e22264

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d1c1d90e10616c5a0b4d96006ac109f27aef24af

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/95a0a8d2ab1007672d6954b34c8fc53c19b04edf

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/06931a9c0e2f59bbc88c6cdfca793fc68508152b

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix handling of container types in find_composite_type_dependenc
@ 2017-08-09 21:03 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-08-09 21:03 UTC (permalink / raw)
  To: pgsql-committers

Fix handling of container types in find_composite_type_dependencies.

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

Branch
------
REL9_2_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e704aac18d1ee80dc79114ef18ec6cd5265f8a3

Modified Files
--------------
src/backend/commands/tablecmds.c     | 49 +++++++++++++++++++++++-------------
src/backend/commands/typecmds.c      | 49 +++++++++++++++++++++++-------------
src/test/regress/expected/domain.out | 17 +++++++++++++
src/test/regress/sql/domain.sql      | 17 +++++++++++++
4 files changed, 97 insertions(+), 35 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2017-08-09 21:03 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>
2017-08-09 21:03 pgsql: Fix handling of container types in find_composite_type_dependenc Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox