Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the Postgres C library called libpq instead of libpg?

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?

like image 515
Alexander Myshov Avatar asked Oct 17 '15 15:10

Alexander Myshov


People also ask

What is Libpq?

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.

Which library will be used to connect PostgreSQL python?

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.

Which function is used to open PostgreSQL connection?

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 .


1 Answers

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.

like image 79
AlexPogue Avatar answered Sep 29 '22 23:09

AlexPogue