pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Further fix dumping of views that contain just VALUES(...).
7+ messages / 1 participants
[nested] [flat]

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/65da6dd1d306dd679b92770b628d44ed6a08db3b

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_6_STABLE

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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

* pgsql: Further fix dumping of views that contain just VALUES(...).
@ 2019-11-17 01:00  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-11-17 01:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/ruleutils.c   | 34 ++++++++++++++++++++++++----------
src/test/regress/expected/rules.out | 12 ++++++++++++
src/test/regress/sql/rules.sql      |  2 ++
3 files changed, 38 insertions(+), 10 deletions(-)



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


end of thread, other threads:[~2019-11-17 01:00 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). Tom Lane <tgl@sss.pgh.pa.us>
2019-11-17 01:00 pgsql: Further fix dumping of views that contain just VALUES(...). 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