pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
6+ messages / 1 participants
[nested] [flat]

* pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 25 ++++++++++++++++++++-----
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 60 insertions(+), 5 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: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 25 ++++++++++++++++++++-----
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 60 insertions(+), 5 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: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 11 +++++++++--
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 49 insertions(+), 2 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: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3a07ba128581dac2f5e6b3eb0b568e2cb09dba33

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 25 ++++++++++++++++++++-----
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 60 insertions(+), 5 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: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 11 +++++++++--
src/test/regress/expected/create_view.out | 26 ++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 46 insertions(+), 2 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: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s
@ 2017-07-24 19:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-07-24 19:17 UTC (permalink / raw)
  To: pgsql-committers

Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.

Various cases involving renaming of view columns are handled by having
make_viewdef pass down the view's current relation tupledesc to
get_query_def, which then takes care to use the column names from the
tupledesc for the output column names of the SELECT.  For some reason
though, we'd missed teaching make_ruledef to do similarly when it is
printing an ON SELECT rule, even though this is exactly the same case.
The results from pg_get_ruledef would then be different and arguably wrong.
In particular, this breaks pre-v10 versions of pg_dump, which in some
situations would define views by means of emitting a CREATE RULE ... ON
SELECT command.  Third-party tools might not be happy either.

In passing, clean up some crufty code in make_viewdef; we'd apparently
modernized the equivalent code in make_ruledef somewhere along the way,
and missed this copy.

Per report from Gilles Darold.  Back-patch to all supported versions.

Discussion: https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c         | 25 ++++++++++++++++++++-----
src/test/regress/expected/create_view.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/create_view.sql      | 11 +++++++++++
3 files changed, 60 insertions(+), 5 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-07-24 19:17 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s Tom Lane <tgl@sss.pgh.pa.us>
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s Tom Lane <tgl@sss.pgh.pa.us>
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s Tom Lane <tgl@sss.pgh.pa.us>
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s Tom Lane <tgl@sss.pgh.pa.us>
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s Tom Lane <tgl@sss.pgh.pa.us>
2017-07-24 19:17 pgsql: Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s 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