#5427 closed defect (fixed)

PG17 change broke our code

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 3.5.0
Component: postgis Version: master
Keywords: PostgreSQL 17 pg17 Cc:

Description

/pg/rel/pg16w64/include/postgresql/internal  -D_GNU_SOURCE   -c -o gserialized_estimate.o gserialized_estimate.c
gserialized_estimate.c: In function ‘compute_gserialized_stats_mode’:
gserialized_estimate.c:1521:46: error: ‘VacAttrStats’ has no member named ‘attr’
 1521 |  histo_cells_target = (int)pow((double)(stats->attr->attstattarget), (double)ndims);
      |                                              ^~
make[1]: *** [<builtin>: gserialized_estimate.o] Error 1
make[1]: Leaving directory '/var/lib/jenkins/workspace/postgis/regress_pgdev/branches/3.4/postgis'
make: *** [GNUmakefile:25: all] Error 1
Build step 'Execute shell' marked build as failure
Finished: FAILURE

guessing the cause was this commit: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c69bdf837f161ae3e699496be10215dbb2315917

Take pg_attribute out of VacAttrStats

The VacAttrStats structure contained the whole Form_pg_attribute for a
column, but it actually only needs attstattarget from there.  So
remove the Form_pg_attribute field and make a separate field for
attstattarget.  This simplifies some code for extended statistics that
doesn't deal with a column but an expression, which had to fake up
pg_attribute rows to satisfy internal APIs.  Also, we can remove some
comments that essentially said "don't look at pg_attribute directly".

Change History (4)

comment:1 by Paul Ramsey <pramsey@…>, 12 months ago

Resolution: fixed
Status: newclosed

In dc1fe8f/git:

Support build on pg17, closes #5427

comment:2 by Laurenz Albe, 12 months ago

The patch is not good enough.

You forgot to fix the references to stats->attr that are in the code block surrounded by #if POSTGIS_DEBUG_LEVEL > 0, at line 1535.

comment:3 by Laurenz Albe, 12 months ago

Resolution: fixed
Status: closedreopened

comment:4 by Paul Ramsey <pramsey@…>, 12 months ago

Resolution: fixed
Status: reopenedclosed

In b21da4c/git:

Remove debug routine as we can no longer feed it the relation id or attribute name from the context available within the analyze hook. Closes #5427

Note: See TracTickets for help on using tickets.