Skip to content

Don't export libpq.so symbols in the postgres binary. (#16234)#1179

Closed
roseduan wants to merge 1 commit intoapache:mainfrom
roseduan:cherry-pick-postgres-fdw-libpq
Closed

Don't export libpq.so symbols in the postgres binary. (#16234)#1179
roseduan wants to merge 1 commit intoapache:mainfrom
roseduan:cherry-pick-postgres-fdw-libpq

Conversation

@roseduan
Copy link
Contributor

Due to Greenplum's MPP architecture, the postgres process needs to connect to databases, some symbols from libpq.so are compiled into the postgres binary as well. However, some symbols are not safe to be exported both in the postgres binary and the libpq.so library. E.g., some of the functions are using palloc()/pfree() to allocate/free memory in backend codes while using malloc()/free() in frontend codes. See issue #16219. This patch resolves the issue by hiding frontend symbols in the postgres binary, so that frontend symbols referenced in extensions will be resolved correctly.

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


Due to Greenplum's MPP architecture, the postgres process needs to connect to
databases, some symbols from libpq.so are compiled into the postgres binary as
well. However, some symbols are not safe to be exported both in the postgres
binary and the libpq.so library. E.g., some of the functions are using
palloc()/pfree() to allocate/free memory in backend codes while using
malloc()/free() in frontend codes. See issue #16219. This patch resolves the
issue by hiding frontend symbols in the postgres binary, so that frontend
symbols referenced in extensions will be resolved correctly.
@roseduan
Copy link
Contributor Author

cherry-pick from gpdb

greenplum-db/gpdb-archive@b3ad725

@roseduan roseduan closed this Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant