pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt
3+ messages / 1 participants
[nested] [flat]

* pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt
@ 2025-08-08 05:38  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-08 05:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_dump: Fix incorrect parsing of object types in pg_dump --filter.

Previously, pg_dump --filter could misinterpret invalid object types
in the filter file as valid ones. For example, the invalid object type
"table-data" (likely a typo for the valid "table_data") could be
mistakenly recognized as "table", causing pg_dump to succeed
when it should have failed.

This happened because pg_dump identified keywords as sequences of
ASCII alphabetic characters, treating non-alphabetic characters
(like hyphens) as keyword boundaries. As a result, "table-data" was
parsed as "table".

To fix this, pg_dump --filter now treats keywords as strings of
non-whitespace characters, ensuring invalid types like "table-data"
are correctly rejected.

Back-patch to v17, where the --filter option was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Reviewed-by: Srinath Reddy <srinath2133@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAHGQGwFzPKUwiV5C-NLBqz1oK1+z9K8cgrF+LcxFem-p3_Ftug@mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/85ccd7e30a6dd378e025a918916f7b1d72004001

Modified Files
--------------
src/bin/pg_dump/filter.c                    | 13 ++++++++-----
src/bin/pg_dump/t/005_pg_dump_filterfile.pl | 14 ++++++++++----
2 files changed, 18 insertions(+), 9 deletions(-)



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

* pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt
@ 2025-08-08 05:38  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-08 05:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_dump: Fix incorrect parsing of object types in pg_dump --filter.

Previously, pg_dump --filter could misinterpret invalid object types
in the filter file as valid ones. For example, the invalid object type
"table-data" (likely a typo for the valid "table_data") could be
mistakenly recognized as "table", causing pg_dump to succeed
when it should have failed.

This happened because pg_dump identified keywords as sequences of
ASCII alphabetic characters, treating non-alphabetic characters
(like hyphens) as keyword boundaries. As a result, "table-data" was
parsed as "table".

To fix this, pg_dump --filter now treats keywords as strings of
non-whitespace characters, ensuring invalid types like "table-data"
are correctly rejected.

Back-patch to v17, where the --filter option was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Reviewed-by: Srinath Reddy <srinath2133@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAHGQGwFzPKUwiV5C-NLBqz1oK1+z9K8cgrF+LcxFem-p3_Ftug@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/bin/pg_dump/filter.c                    | 13 ++++++++-----
src/bin/pg_dump/t/005_pg_dump_filterfile.pl | 14 ++++++++++----
2 files changed, 18 insertions(+), 9 deletions(-)



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

* pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt
@ 2025-08-08 05:38  Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Fujii Masao @ 2025-08-08 05:38 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

pg_dump: Fix incorrect parsing of object types in pg_dump --filter.

Previously, pg_dump --filter could misinterpret invalid object types
in the filter file as valid ones. For example, the invalid object type
"table-data" (likely a typo for the valid "table_data") could be
mistakenly recognized as "table", causing pg_dump to succeed
when it should have failed.

This happened because pg_dump identified keywords as sequences of
ASCII alphabetic characters, treating non-alphabetic characters
(like hyphens) as keyword boundaries. As a result, "table-data" was
parsed as "table".

To fix this, pg_dump --filter now treats keywords as strings of
non-whitespace characters, ensuring invalid types like "table-data"
are correctly rejected.

Back-patch to v17, where the --filter option was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Reviewed-by: Srinath Reddy <srinath2133@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAHGQGwFzPKUwiV5C-NLBqz1oK1+z9K8cgrF+LcxFem-p3_Ftug@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7dafc4a413f42a6c0e13c91e50e05329f91e954f

Modified Files
--------------
src/bin/pg_dump/filter.c                    | 13 ++++++++-----
src/bin/pg_dump/t/005_pg_dump_filterfile.pl | 14 ++++++++++----
2 files changed, 18 insertions(+), 9 deletions(-)



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


end of thread, other threads:[~2025-08-08 05:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-08 05:38 pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt Fujii Masao <fujii@postgresql.org>
2025-08-08 05:38 pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt Fujii Masao <fujii@postgresql.org>
2025-08-08 05:38 pgsql: pg_dump: Fix incorrect parsing of object types in pg_dump --filt Fujii Masao <fujii@postgresql.org>

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