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
2 answers

PostgreSQL libpq: PQNumber and column aliases

In a Postgres libpq sql there is a function PQfnumber: Returns the column number associated with the given column name. Lets say I have a select: select a.*, b.* from a, b where a.id = b.id now if I will call number = PQfnumber(pgresult,…
Tadzys
  • 1,044
  • 3
  • 16
  • 22
0
votes
0 answers

An error occurred while installing pg (1.3.5), and Bundler cannot continue

On doing bundle install for this rails project, i am facing with this issue. My Mac details Chip - Apple M1 Pro macOS - 13.4.1 I have gone through most of the other articles based on the same issue, but nothing seems to solve the issue. On…
0
votes
0 answers

C++ and PostgreSQL connecting problem (libpqxx library)

When I try to install PostgreSQL for C++ (libpqxx library) I receive this error: # cmake .. -- Building for: Ninja -- The CXX compiler identification is GNU 13.1.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check…
Dragoș
  • 1
  • 1
0
votes
2 answers

Linker fails when using libpqxx with CMake

I'm trying to build a simple C++ program with libpqxx using CMake. But the linker fails on both Linux and macOS. It cannot identify C++-related headers and libraries, whereas C files related to libpq are found with the provided find_package() and…
0
votes
0 answers

Library not loaded: @rpath/libpq.5.dylib when start rust app

when I tried to start debugging the rust application in visual studio code in macOS 13.2 with Intel chip, the log output like this: dyld[33431]: Library not loaded: @rpath/libpq.5.dylib Referenced from:
Dolphin
  • 29,069
  • 61
  • 260
  • 539
0
votes
0 answers

Bad file descriptor error message postgresql

On one of our legacy systems we receive this error message from libpq driver of postgresql. It happens at random times for any of our SQL statements. psql query begin returned PGRES_FATAL_ERROR - could not receive data from server: Bad file…
user510799
  • 63
  • 5
0
votes
0 answers

Issue of SCRAM authentication and libpq version while connecting to PostgreSQL using R

I am trying to connect to postgreSQL database using R but I am getting an error : pg_connect(): Unable to connect to PostgreSQL server: SCRAM authentication requires libpq version 10 or above. I have looked at few pages including this link I tried…
0
votes
1 answer

Julia, get and set a column datatype in PostgreSQL

I've searched a lot everywhere, but could not find a clear solution, despite this is, I thihk, a basic simple question. Finally wanna make clear this. :p The basic problem is how to get datatype or convert,maybe. ex. Type[String] -> String Ok, the…
onoke
  • 79
  • 6
0
votes
0 answers

libpq.so.5: cannot open shared object file

I am trying to take a backup programmatically using pg_dump. I have copied all pg utilities under bin directory of /usr/pgsql-12/. I have also copied the library from /usr/lib/x86_64-linux-gnu to /usr/pgsql-12/lib and added /usr/pgsql-12/lib to PATH…
0
votes
0 answers

How to fix SCRAM authentication requires libpq version 10 or above in symfony?

I am following the symfony fast-track book at symfony. But when I want to create an entity class with: $ symfony console make:entity Conference I got this error: An exception occurred in the driver: SQLSTATE[08006] [7] SCRAM authentication requires…
Gunnarius
  • 59
  • 5
0
votes
1 answer

libpq ERROR: insufficient data left in message

I am using libpq to interact with PostgreSQL DB. I'm getting below error while trying to update the table. ERROR: insufficient data left in message I have created a sample code with same parameters and it also is giving me the same error Below is…
0
votes
1 answer

libpq error: ERROR: invalid byte sequence for encoding "UTF8": 0x00

I am trying to insert values to a postgresql table using libpq (in Binary Format). Below is my query insert into client_data (serverid,ipaddress,portid) values ($1,$2,$3) The data type for table fields are as follows serverid -> smallint…
0
votes
2 answers

AWS Glue: SCRAM authentication requires libpq version 10 or above [Using CockroachDB]

I have a glue job using psycopg2 that was previously working, and now is throwing this error: OperationalError: SCRAM authentication requires libpq version 10 or above. Here is the psycopg2 version and libpq version: 2.9.5 (dt dec pq3…
0
votes
1 answer

OCIDefineArrayOfStruct() or OCIBindArrayOfStruct equivalent in PostgreSQL

I am currently working updating client side code from OCI to libq. I am aware that OCIDefineArrayOfStruct() and OCIBindArrayOfStruct() are used to improve performance by enabling multi-row, multi-column fetch. Is there any way to do same using…
0
votes
1 answer

libpq-fe.h: No such file or directory (Ubuntu 20)

Compiling in Ubuntu 20.04.4 LTS, g++ returns libpq-fe.h is not found The system already has it installed (sudo apt-get install libpq-dev) in /usr/include/postgresql/libpq-fe.h I tried to set the compilation path with option…
alboforlizo
  • 170
  • 1
  • 6