Questions tagged [libpq]

libpq is the C application programmer's interface to PostgreSQL. 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. So some aspects of libpq's behavior will be important to you if you use one of those packages.

Client programs that use libpq must include the header file libpq-fe.h and must link with the libpq library.

345 questions
1
vote
1 answer

PostgreSQL 11 installer for Windows x86?

I need to build an x86 Windows application using libpq.lib. Before I only used x64. I'm currently using an installation from postgresql-11.6-1-windows-x64.exe. In the name it says 'x64' allthough on…
A. Geisler
  • 43
  • 4
1
vote
1 answer

Why is postgres taking computer user as login user?

I am trying to test wal2json on my system with Postgresql database. I have made changes in my postgresql.conf & pg_hba.conf file as shown in this link: https://github.com/eulerto/wal2json But when I am trying to create a test slot using postgres…
rsp
  • 813
  • 2
  • 14
  • 26
1
vote
1 answer

How does one configure TCP_NODELAY for libpq and postgres server?

I am trying to ensure that TCP_NODELAY is set (Nagle disabled) for Postgres client and server. I can see that there is code in libpq to use the option when a TCP_NODELAY macro is defined. I've cloned the postgres repo, run: ./configure make…
CamW
  • 3,223
  • 24
  • 34
1
vote
1 answer

postgresql libpqxx: Several queries as one transaction

When inserting/updating data in postgresql, it is easy to execute multiple statements in one transaction. (My goal here is to avoid a server round-trip for each statement, although the transactional isolation is often useful.) When querying, I'm…
jma
  • 3,580
  • 6
  • 40
  • 60
1
vote
1 answer

Postgresql and libpq . Query getting dropped from randrom number of child processes

I have forked 4 client process from parent. For testing purpose, i execute an sql query in the child process when i receive valid input. My debug show that i received the valid string in all the child process. In most cases, PQsendquery is sent out.…
1
vote
1 answer

Memory is not freed when connection to database is closed (C, postgres - libpq)

If you create a program with just the following two lines: PGconn *conn = PQconnectdb("user=dbtest password=dbtest dbname=testdb host=localhost port=5432"); PQfinish(conn); And run it through valgrind like so: valgrind --leak-check=full…
I_cannot_C
  • 23
  • 4
1
vote
0 answers

How to install "psycopg2" properly in this situation

I'm installing psycopg2 package for my project. pip install psycopg2 then I got this error: Collecting psycopg2 Using cached…
romlym
  • 561
  • 1
  • 7
  • 26
1
vote
1 answer

can I use master libpq in production

Is it ok to use the master branch of lib/pq in production? When you execute go get gitlab.com/lib/pq you get the master branch, but there is a release v1.0.0. Would it be better to use releases instead of master branch?
1
vote
1 answer

Link error with libpq using C++

I'm trying to use libpq to connect to my PostgreSQL database and intend to call pre-defined functions once I get this working. Right now I just have the conninfo string entered, and test the connection. After finally figuring out how to include…
AlwaysWrong
  • 526
  • 4
  • 9
1
vote
0 answers

libpq + xcode: how to compile

ALL, I recently bought myself a new Mac and started testing my application with the latest PostgreSQL + libpq. I built libpq (only) from sources and installed it according to the following: ./configure cd interface/src/libpq make sudo make…
Igor
  • 5,620
  • 11
  • 51
  • 103
1
vote
1 answer

In C, why do preferred RDBMS' drivers implement different API, instead of a uniform API?

In Java, mostly different RDBMS' drivers implement JDBC API. In Python, mostly different RDBMS' drivers implement DB-API2. In C, although we have ODBC as uniform API for different RDBMS', people in general prefer RDBMS-specific API, such as those…
Tim
  • 1
  • 141
  • 372
  • 590
1
vote
1 answer

Is there uniform API in C for different RDBMS'?

I like the idea of JDBC for Java and DB-API for Python, which both provide uniform APIs for accessing different relational database management systems. What is it like in C? Is there uniform API in C for different RDBMS'? I haven't found one, or I…
Tim
  • 1
  • 141
  • 372
  • 590
1
vote
1 answer

PostgreSQL: How can my C (libpq) program detect which table constraint triggered error?

I am trying to programmatically migrate a large dataset from an old MySQL database to PostgreSQL. The source data is a mess, so my pgsql tables have a bunch of constraints to catch bad data going in. When an insert fails because of one of these…
Alan Evans
  • 13
  • 3
1
vote
1 answer

Missing dependency libpq.so.4 on Centos 5

Possible Duplicate: pg_config, ruby pg, postgresql 9.0 problem after upgrade, centos 5 This is driving me mad. I'm tring to install postgresql on a fresh Centos 5 installation and I get that dependency error when I do yum install postgresql. I…
nemesisdesign
  • 8,159
  • 12
  • 58
  • 97
1
vote
1 answer

Julia 0.6 to Postgres connection - Available options and LibPq.jl

I was with Julia 0.5 and used PostgreSql.jl to connect to the Database. It internally uses DBI.jl dependency. Now upgrading to version 0.6, this has stopped working. The only alternative I could find online is LibPQ.jl. However, the library is a…
Sid
  • 4,893
  • 14
  • 55
  • 110