diff options
author | Nathan Bossart <nathan@postgresql.org> | 2025-05-20 16:31:00 -0500 |
---|---|---|
committer | Nathan Bossart <nathan@postgresql.org> | 2025-05-20 16:31:00 -0500 |
commit | a6060f1cbec39575634043baeeaeb11e86042fa6 (patch) | |
tree | af324157f82d1f6c89b105c063416bc914424d21 /src/include/access/gistxlog.h | |
parent | cbf53e2b8a8ed3fc6f554095a4e99591bd5193f6 (diff) | |
download | postgresql-a6060f1cbec39575634043baeeaeb11e86042fa6.tar.gz postgresql-a6060f1cbec39575634043baeeaeb11e86042fa6.zip |
pg_dump: Fix array literals in fetchAttributeStats().
Presently, fetchAttributeStats() builds array literals by treating
the elements as SQL identifiers. This is incorrect for a couple of
reasons:
* Array literal content must match the external text representation
of the array, i.e., what array_out() would return. One notable
problem is that double quotes are escaped with "" in identifiers
but with \" in array literals. To fix, build the array content
using the pre-existing appendPGArray() function.
* Array literals must be written as string constants. A notable
problem here is that single quotes are escaped via '' in strings
but are not escaped in the text representation of an array. To
fix, append the aforementioned array literal content to the query
with appendStringLiteralAH().
While at it, modify a test case to use an identifier that would
cause the test to fail without this change.
Oversight in commit 9c02e3a986.
Reported-by: Philippe Beaudoin <pbh.emaj@free.fr>
Author: Jian He <jian.universality@gmail.com>
Co-authored-by: Nathan Bossart <nathandbossart@gmail.com>
Co-authored-by: Stepan Neretin <slpmcf@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Bug: #18923
Discussion: https://postgr.es/m/18923-e79273f87c6bed69%40postgresql.org
Diffstat (limited to 'src/include/access/gistxlog.h')
0 files changed, 0 insertions, 0 deletions