pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Install infrastructure to manage psql's hidden query labels bett 2+ messages / 1 participants [nested] [flat]
* pgsql: Install infrastructure to manage psql's hidden query labels bett @ 2026-10-15 18:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-10-15 18:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Install infrastructure to manage psql's hidden query labels better. Commit 41d69e6dc added labels to psql's internally-generated queries, which are sent to the server and possibly recorded in the server log. In that commit we always attempted to translate the labels per psql's NLS environment, but that is hazardous: non-ASCII labels might fail to be translatable to the server's encoding, rendering some or all of these operations unusable since the server will throw an error and not execute the query. Hence, we need some gating checks to decide whether it's safe to translate a label. To allow that to be managed in just one place, invent a new function addQueryComment() that is responsible for outputting these labels. (Probably it should have been done that way to start with, but better late than never.) This commit just does the heavy lifting of creating that function and fixing all the call sites. The actual choice of whether to translate is stubbed out, so that this commit in itself changes no behavior. Once we've settled on the correct gating checks to use, a much smaller follow-on commit will install them. Author: shihao zhong <zhong950419@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAGRkXqRv7yhBOhF0YvSr6ZB7rvsPCjnXSPj8=3bKcSJuYvNrBA@mail.gmail.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/294d2196c7abec253fd3959d3ca4c6dcae3068d6 Modified Files -------------- src/bin/psql/command.c | 8 +- src/bin/psql/common.c | 22 ++++++ src/bin/psql/common.h | 2 + src/bin/psql/describe.c | 191 ++++++++++++++++++++---------------------------- src/bin/psql/nls.mk | 3 +- 5 files changed, 110 insertions(+), 116 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Install infrastructure to manage psql's hidden query labels bett @ 2026-10-15 18:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2026-10-15 18:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Install infrastructure to manage psql's hidden query labels better. Commit 41d69e6dc added labels to psql's internally-generated queries, which are sent to the server and possibly recorded in the server log. In that commit we always attempted to translate the labels per psql's NLS environment, but that is hazardous: non-ASCII labels might fail to be translatable to the server's encoding, rendering some or all of these operations unusable since the server will throw an error and not execute the query. Hence, we need some gating checks to decide whether it's safe to translate a label. To allow that to be managed in just one place, invent a new function addQueryComment() that is responsible for outputting these labels. (Probably it should have been done that way to start with, but better late than never.) This commit just does the heavy lifting of creating that function and fixing all the call sites. The actual choice of whether to translate is stubbed out, so that this commit in itself changes no behavior. Once we've settled on the correct gating checks to use, a much smaller follow-on commit will install them. Author: shihao zhong <zhong950419@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAGRkXqRv7yhBOhF0YvSr6ZB7rvsPCjnXSPj8=3bKcSJuYvNrBA@mail.gmail.com Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5b5e072ef8ae9e76cdcc2eee05db8dd6c08f910b Modified Files -------------- src/bin/psql/command.c | 8 +- src/bin/psql/common.c | 22 ++++++ src/bin/psql/common.h | 2 + src/bin/psql/describe.c | 191 ++++++++++++++++++++---------------------------- src/bin/psql/nls.mk | 3 +- 5 files changed, 110 insertions(+), 116 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-10-15 18:45 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-15 18:45 pgsql: Install infrastructure to manage psql's hidden query labels bett Tom Lane <tgl@sss.pgh.pa.us> 2026-10-15 18:45 pgsql: Install infrastructure to manage psql's hidden query labels bett 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