pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix pg_get_indexdef()'s behavior for included index columns. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix pg_get_indexdef()'s behavior for included index columns. @ 2018-07-19 18:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2018-07-19 18:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_get_indexdef()'s behavior for included index columns. The multi-argument form of pg_get_indexdef() failed to print anything when asked to print a single index column that is an included column rather than a key column. This seems an unintentional result of someone having tried to take a short-cut and use the attrsOnly flag for two different purposes. To fix, split said flag into two flags, attrsOnly which suppresses non-attribute info, and keysOnly which suppresses included columns. Add a test case using psql's \d command, which relies on that function. (It's mighty tempting at this point to replace pg_get_indexdef_worker's mess of boolean flag arguments with a single bitmask-of-flags argument, which would allow making the call sites much more self-documenting. But I refrained for the moment.) Discussion: https://postgr.es/m/21724.1531943735@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/028e3da2949482fa56f3ffdbda840782f2953b0b Modified Files -------------- src/backend/utils/adt/ruleutils.c | 45 ++++++++++++++++----------- src/test/regress/expected/index_including.out | 10 ++++++ src/test/regress/sql/index_including.sql | 1 + 3 files changed, 38 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix pg_get_indexdef()'s behavior for included index columns. @ 2018-07-19 18:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2018-07-19 18:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_get_indexdef()'s behavior for included index columns. The multi-argument form of pg_get_indexdef() failed to print anything when asked to print a single index column that is an included column rather than a key column. This seems an unintentional result of someone having tried to take a short-cut and use the attrsOnly flag for two different purposes. To fix, split said flag into two flags, attrsOnly which suppresses non-attribute info, and keysOnly which suppresses included columns. Add a test case using psql's \d command, which relies on that function. (It's mighty tempting at this point to replace pg_get_indexdef_worker's mess of boolean flag arguments with a single bitmask-of-flags argument, which would allow making the call sites much more self-documenting. But I refrained for the moment.) Discussion: https://postgr.es/m/21724.1531943735@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0f49a2de96e7b58e15899b2639e096b771e45886 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 45 ++++++++++++++++----------- src/test/regress/expected/index_including.out | 10 ++++++ src/test/regress/sql/index_including.sql | 1 + 3 files changed, 38 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-07-19 18:54 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-07-19 18:54 pgsql: Fix pg_get_indexdef()'s behavior for included index columns. Tom Lane <tgl@sss.pgh.pa.us> 2018-07-19 18:54 pgsql: Fix pg_get_indexdef()'s behavior for included index columns. 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