diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 9ab0f6c6b..2f8f206e8 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -449,6 +449,12 @@ class PlatformRepository extends ArrayRepository break; case 'pgsql': + if ($this->runtime->hasConstant('PGSQL_LIBPQ_VERSION')) { + $this->addLibrary('pgsql-libpq', $this->runtime->getConstant('PGSQL_LIBPQ_VERSION'), 'libpq for pgsql'); + break; + } + // intentional fall-through to next case... + case 'pdo_pgsql': $info = $this->runtime->getExtensionInfo($name); diff --git a/tests/Composer/Test/Repository/PlatformRepositoryTest.php b/tests/Composer/Test/Repository/PlatformRepositoryTest.php index 9e791a776..74f6c3179 100644 --- a/tests/Composer/Test/Repository/PlatformRepositoryTest.php +++ b/tests/Composer/Test/Repository/PlatformRepositoryTest.php @@ -998,6 +998,8 @@ pgsql.auto_reset_persistent => Off => Off pgsql.ignore_notice => Off => Off pgsql.log_notice => Off => Off', ['lib-pgsql-libpq' => '12.2'], + [], + [['PGSQL_LIBPQ_VERSION', null, '12.2']], ], 'pdo_pgsql' => [ 'pdo_pgsql',