pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add functions pg_set_attribute_stats() and pg_clear_attribute_st
2+ messages / 2 participants
[nested] [flat]

* pgsql: Add functions pg_set_attribute_stats() and pg_clear_attribute_st
@ 2024-10-22 22:24  Jeff Davis <jdavis@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Jeff Davis @ 2024-10-22 22:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add functions pg_set_attribute_stats() and pg_clear_attribute_stats().

Enable manipulation of attribute statistics. Only superficial
validation is performed, so it's possible to add nonsense, and it's up
to the planner (or other users of statistics) to behave reasonably in
that case.

Bump catalog version.

Author: Corey Huinker
Discussion: https://postgr.es/m/CADkLM=eErgzn7ECDpwFcptJKOk9SxZEk5Pot4d94eVTZsvj3gw@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/func.sgml                     |  72 +++
src/backend/catalog/system_functions.sql   |  22 +
src/backend/statistics/Makefile            |   1 +
src/backend/statistics/attribute_stats.c   | 869 +++++++++++++++++++++++++++++
src/backend/statistics/meson.build         |   1 +
src/backend/statistics/stat_utils.c        |  73 +++
src/include/catalog/catversion.h           |   2 +-
src/include/catalog/pg_proc.dat            |  14 +
src/include/statistics/stat_utils.h        |   7 +
src/test/regress/expected/stats_import.out | 659 +++++++++++++++++++++-
src/test/regress/sql/stats_import.sql      | 545 ++++++++++++++++++
11 files changed, 2263 insertions(+), 2 deletions(-)



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

* Re: pgsql: Add functions pg_set_attribute_stats() and pg_clear_attribute_st
@ 2024-10-23 03:18  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jeff Davis <jdavis@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-10-23 03:18 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Jeff Davis <jdavis@postgresql.org> writes:
> Add functions pg_set_attribute_stats() and pg_clear_attribute_stats().

A couple of buildfarm animals, eg [1], are mildly unhappy:

In file included from ../../../src/include/nodes/execnodes.h:37:0,
                 from ../../../src/include/catalog/indexing.h:19,
                 from attribute_stats.c:21:
attribute_stats.c: In function \342\200\230text_to_stavalues\342\200\231:
../../../src/include/nodes/miscnodes.h:54:15: warning: the comparison will always evaluate as \342\200\230true\342\200\231 for the address of \342\200\230escontext\342\200\231 will never be NULL [-Waddress]
  ((escontext) != NULL && IsA(escontext, ErrorSaveContext) && \\
               ^
attribute_stats.c:636:6: note: in expansion of macro \342\200\230SOFT_ERROR_OCCURRED\342\200\231
  if (SOFT_ERROR_OCCURRED(&escontext))
      ^

I think what we've done in other places is just to test
escontext.error_occurred directly, since the rest of the
macro is useless in this situation.

			regards, tom lane

[1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=rhinoceros&dt=2024-10-23%2000%3A47...





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


end of thread, other threads:[~2024-10-23 03:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-22 22:24 pgsql: Add functions pg_set_attribute_stats() and pg_clear_attribute_st Jeff Davis <jdavis@postgresql.org>
2024-10-23 03:18 ` 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