Opened 10 months ago

Closed 9 months ago

#5100 closed defect (fixed)

Installation failure with PostgreSQL v15 (no more pg_atoi)

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 3.1.6
Component: build/upgrade/install Version: 3.2.x
Keywords: Cc: Laurenz Albe

Description

I think this is a PostgreSQL 15 new issue.

Debbie is complaining when compiling against PG 15

17:17:47 gserialized_typmod.c: In function ‘gserialized_typmod_in’:
17:17:47 gserialized_typmod.c:275:19: warning: implicit declaration of function ‘pg_atoi’; did you mean ‘pg_ltoa’? [-Wimplicit-function-declaration]
17:17:47   275 |    int32_t srid = pg_atoi(DatumGetCString(elem_values[i]), sizeof(int32), '\0');
17:17:47       |                   ^~~~~~~
17:17:47       |                   pg_ltoa

17:02:23 psql:/var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/share/contrib/postgis/postgis.sql:138: ERROR:  could not load library "/var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/lib/postgis-3.so": /var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/lib/postgis-3.so: undefined symbol: pg_atoi
17:02:23 -----------------------------------------------------------------------------
17:02:23  failed (Error encountered loading /var/lib/jenkins/workspace/postgis/branches/3.3/regress/00-regress-install/share/contrib/postgis/postgis_comments.sql: /var/lib/jenkins/workspace/postgis/tmp/3_3_pg15w64/regress_log)
17:02:23 -----------------------------------------------------------------------------
17:02:23 NOTICE:  schema "public" already exists, skipping

Attachments (1)

0001-Stop-using-pg_atoi.patch (3.1 KB ) - added by Laurenz Albe 10 months ago.
Patch to fix the problem

Download all attachments as: .zip

Change History (12)

comment:1 by Laurenz Albe, 10 months ago

Cc: Laurenz Albe added
Component: postgisbuild/upgrade/install
Owner: changed from pramsey to strk
Summary: PostgreSQL 15 failureInstallation failure with PostgreSQL v15 (no more pg_atoi)

by Laurenz Albe, 10 months ago

Patch to fix the problem

comment:2 by Laurenz Albe, 10 months ago

Owner: changed from strk to pramsey

comment:3 by Laurenz Albe, 10 months ago

PostgreSQL commit 73508475d69e90f98ebd9b7e1a5933a26a49c5e9 has removed pg_atoi, so building or creating the extension fails.

The attached patch fixes the problem. This should be applied to all branches.

comment:4 by robe, 10 months ago

Thanks. So this is backward compatible with all supported versions of PostgreSQL right? so safe to backport to 3.2, 3.1, and 3.0

comment:5 by robe, 10 months ago

Owner: changed from pramsey to robe

comment:6 by Regina Obe <lr@…>, 10 months ago

In ae53a53/git:

Fix PG 15 building atoi removed. References #5100 for PostGIS 3.3.0

comment:7 by Regina Obe <lr@…>, 10 months ago

In e8d1e867/git:

Fix PG 15 building pg_atoi removed. References #5100 for PostGIS 3.2.2

comment:8 by Laurenz Albe, 10 months ago

Yes, that should be safe. All it does is replace the removed function call with the function definition. Thanks for taking care of this!

comment:9 by robe, 9 months ago

Milestone: PostGIS 3.3.0PostGIS 3.0.6

comment:10 by robe, 9 months ago

Milestone: PostGIS 3.0.6PostGIS 3.1.6

comment:11 by Regina Obe <lr@…>, 9 months ago

Resolution: fixed
Status: newclosed

In f1e799c/git:

Stop using pg_atoi, removed in PG 15
Closes #5100 for PostGIS 3.1.6

Note: See TracTickets for help on using tickets.