agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: postgres_fdw: Disable attribute statistics import from pre-9.1 s
2+ messages / 1 participants
[nested] [flat]

* pgsql: postgres_fdw: Disable attribute statistics import from pre-9.1 s
@ 2026-09-14 10:04  Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Etsuro Fujita @ 2026-09-14 10:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

postgres_fdw: Disable attribute statistics import from pre-9.1 servers.

To import attribute statistics, postgres_fdw sent a query wity COLLATE
"C" to remote servers without checking their version.  Since COLLATE is
only supported since v9.1, this could break the import against older
servers; fix by modifying postgres_fdw to check their version and if
older, fall back to sampling.  (This commit still allows importing only
relation statistics from such an older server.)

Also, expand the documentation to mention that attribute statistics are
stored into the local server without applying the foreign table columns'
n_distinct option.

Oversight in commit 28972b6fc.

Reported-by: Fujii Masao <masao.fujii@gmail.com>
Reported-by: Osama Abdul Qader <osamaabdulqader.cs@gmail.com>
Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwH8%2BuDTwfohpck9v_9L3nwSWACbmC36JYRyqHd5xQN_OA%40mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3ca4abd60ce3661c6ccd3d83a13986ef9541bf40

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 35 +++++++++++++++++++++++------------
doc/src/sgml/postgres-fdw.sgml      | 11 ++++++-----
2 files changed, 29 insertions(+), 17 deletions(-)



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

* pgsql: postgres_fdw: Disable attribute statistics import from pre-9.1 s
@ 2026-09-14 10:04  Etsuro Fujita <efujita@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Etsuro Fujita @ 2026-09-14 10:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

postgres_fdw: Disable attribute statistics import from pre-9.1 servers.

To import attribute statistics, postgres_fdw sent a query wity COLLATE
"C" to remote servers without checking their version.  Since COLLATE is
only supported since v9.1, this could break the import against older
servers; fix by modifying postgres_fdw to check their version and if
older, fall back to sampling.  (This commit still allows importing only
relation statistics from such an older server.)

Also, expand the documentation to mention that attribute statistics are
stored into the local server without applying the foreign table columns'
n_distinct option.

Oversight in commit 28972b6fc.

Reported-by: Fujii Masao <masao.fujii@gmail.com>
Reported-by: Osama Abdul Qader <osamaabdulqader.cs@gmail.com>
Author: Etsuro Fujita <etsuro.fujita@gmail.com>
Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwH8%2BuDTwfohpck9v_9L3nwSWACbmC36JYRyqHd5xQN_OA%40mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3e44c8a441f34117b3e6369fadfcbc94c7ae537d

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 35 +++++++++++++++++++++++------------
doc/src/sgml/postgres-fdw.sgml      | 11 ++++++-----
2 files changed, 29 insertions(+), 17 deletions(-)



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


end of thread, other threads:[~2026-09-14 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14 10:04 pgsql: postgres_fdw: Disable attribute statistics import from pre-9.1 s Etsuro Fujita <efujita@postgresql.org>
2026-09-14 10:04 pgsql: postgres_fdw: Disable attribute statistics import from pre-9.1 s Etsuro Fujita <efujita@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox