libpq is the C language interface to PostgreSQL. Use it to connect to AnalyticDB for PostgreSQL from C programs and run queries, inserts, updates, and deletes.
After installing Greenplum or PostgreSQL, find the libpq static and dynamic libraries in the lib directory.
For AnalyticDB for PostgreSQL V7.0, install PostgreSQL 12 to get the correct version of libpq.
Prerequisites
Before you begin, ensure that you have:
The internal or public endpoint of your AnalyticDB for PostgreSQL instance:
Internal endpoint — use this if your client runs on an Elastic Compute Service (ECS) instance in the same region and network type as the database instance. Find it in the AnalyticDB for PostgreSQL console under Basic Information > Database Connection Information.
Public endpoint — use this if your client is on an ECS instance in a different region or network type, or runs outside Alibaba Cloud. See Manage public endpoints to request one.
Your client IP address added to the instance IP address whitelist. See Configure an IP address whitelist.
References
AnalyticDB for PostgreSQL V6.0 — Example programs | libpq - C Library
AnalyticDB for PostgreSQL V7.0 — Example programs | libpq - C Library
Greenplum documentation — includes a libpq package