Everything in the Postgres world has common abbreviation pg
, and it seems more logical to call Postgres' c-library libpg
, rather than libpq
. Why is it called libpq
? Is libpg
already taken by another tool?
libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries. libpq is also the underlying engine for several other PostgreSQL application interfaces, including those written for C++, Perl, Python, Tcl and ECPG.
Psycopg2 is the most widely known and used PostgreSQL connector library in Python. The Psycopg2 library implements the Python DB API 2.0 specifications and (under the hood) uses the C programming language as a wrapper around the libpq PostgreSQL library.
pg_connect() opens a connection to a PostgreSQL database specified by the connection_string . If a second call is made to pg_connect() with the same connection_string as an existing connection, the existing connection will be returned unless you pass PGSQL_CONNECT_FORCE_NEW as flags .
From https://pgolub.wordpress.com/2010/09/21/libpq-stands-for/, credited to Bruce Momjian:
Libpq is called ‘libpq’ because of the original use of the QUEL query language, i.e. lib Post-QUEL. We have a proud backward-compatibility history with this library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With