Skip to content

ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards#21437

Closed
KentarouTakeda wants to merge 1 commit intophp:masterfrom
KentarouTakeda:pgsql-remove-dead-VE_PG_LO64-guards
Closed

ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards#21437
KentarouTakeda wants to merge 1 commit intophp:masterfrom
KentarouTakeda:pgsql-remove-dead-VE_PG_LO64-guards

Conversation

@KentarouTakeda
Copy link
Contributor

@KentarouTakeda KentarouTakeda commented Mar 14, 2026

The guards reference undefined VE_PG_LO64, a misspelling of HAVE_PG_LO64 (removed in GH-14628), making the 64-bit code paths permanently dead. Remove the guards to unconditionally enable the 64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek().

Dropped from GH-21386 as not suitable for backport.


#ifdef VE_PG_LO64
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
offset = lo_tell64((PGconn *)pgsql->conn, pgsql->lofd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would definitely prefer to have this as only path so we can deal with small and large objects all alike. same for lo_truncate part

offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
}
#else
offset = lo_tell((PGconn *)pgsql->conn, pgsql->lofd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I m trying to say with the changes we lose the ability to deal with 2GB+ objects. the *64 variant can deal with small objects too.

… guards

The guards reference undefined VE_PG_LO64, a misspelling of
HAVE_PG_LO64 (removed in phpGH-14628), making the 64-bit code paths
permanently dead. Remove the guards to unconditionally enable the
64-bit variants for PostgreSQL >= 9.3, consistent with pg_lo_seek().

Dropped from phpGH-21386 as not suitable for backport.
@KentarouTakeda KentarouTakeda changed the title ext/pgsql: Remove dead VE_PG_LO64 guards from pg_lo_tell()/pg_lo_truncate() ext/pgsql: Enable lo_tell64/lo_truncate64 by removing dead VE_PG_LO64 guards Mar 14, 2026
@KentarouTakeda KentarouTakeda force-pushed the pgsql-remove-dead-VE_PG_LO64-guards branch from 1340e30 to f308aee Compare March 14, 2026 04:26
@KentarouTakeda
Copy link
Contributor Author

Thanks, you're right. Updated to use the *64 variants unconditionally for PostgreSQL >= 9.3, consistent with pg_lo_seek(). Also updated the PR description accordingly.

@devnexen devnexen closed this in 31962aa Mar 14, 2026
@devnexen
Copy link
Member

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants