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

link to libpq failed with unresolved symbol _PQconnectdb

I use Qt5, msvc2010, windows7 64bit. I want to test if i can link libpq.lib. http://www.postgresql.org/docs/9.2/static/libpq-example.html I build the above example in QtCreator. And get error LNK2019: unresolved external symbol _PQconnectdb in…
Aylwyn Lake
  • 1,919
  • 4
  • 26
  • 36
1
vote
0 answers

Settings SO_REUSEADDR in libpq

Is there a way to instruct libpq library to set SO_REUSEADDR option for sockets it opens?
Andrei Petrenko
  • 3,922
  • 3
  • 31
  • 53
1
vote
1 answer

gem install pg works but bundle install doesn't

env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config works but when I try to run bundle install it throws this error Can't find the PostgreSQL client library (libpq)
Tyler
  • 2,346
  • 6
  • 33
  • 59
1
vote
1 answer

How to get error line/column number from SQL syntax error or executing exception from libpq?

When I execute a SQL command via libpq, it reports error message if there's some error something like this. Error Domain=PQConnection Code=1 "ERROR: syntax error at or near "fef" LINE 1: fef ^ This is string message. I can parse the…
eonil
  • 83,476
  • 81
  • 317
  • 516
1
vote
0 answers

Structure similiar to MYSQL_ROW of MySQL in PostgreSQL?

I recently downloaded a source package from a website which mentioned that its compatible with PostgreSQL and MySQL database. I tried compilation on Linux Debian machine using MySQL and it works fine. However our requirements have changed now and we…
chingupt
  • 403
  • 2
  • 7
  • 19
1
vote
1 answer

PostgreSQL, libpq/C, update parameters

I can update record in table by string manipulation which have some weakness. So, now I'm try to update with parameters but this don't go as I thought. sprintf(sql, "%s%s%s%s%s%d%s", "UPDATE ", mytable, " SET ", "my_id=$0, mystr1=$1,…
Wine Too
  • 4,515
  • 22
  • 83
  • 137
1
vote
3 answers

Connect iPhone App to PostgreSQL Using Libpq

I need to create an application for the iPhone that will connect to a PostgreSQL 8.4 database using libpq. The problem is I can't get a simple iPhone that links to libpq to compile. I am however able to get the equivalent application that is a…
Kuberchaun
  • 29,160
  • 7
  • 51
  • 59
1
vote
1 answer

add libpq-fe.h to qt existing project

I have a C code that uses libpq-fe.h for connecting into a postgresql database. Locally it runs well and everything but now we are trying to use it in a QT existing project. Why not using the qpsql driver instead? Well, the program itself is in…
Edgar Sampere
  • 263
  • 4
  • 24
1
vote
1 answer

Binary query slower than text query+convert with Postgresql?

Searched high and low for this one, and haven't managed to find a definitive answer. I'm just getting started architecting an application and we've decided to use Postgresql for our database, and C for the server. Some initial tests are showing…
Teeleton
  • 11
  • 1
1
vote
1 answer

libpq - PQreset when PQconnectdb fails

If I try to establish a connection via PQconnectdb and it fails, is it ok to call PQreset on PGconn* to retry or does it only work if I've already been connected once?
Ilia Choly
  • 18,070
  • 14
  • 92
  • 160
1
vote
1 answer

Is there a way to list PostgreSQL servers?

Currently I am writing client to PostgreSQL servers. I want to list the details (ip address and port number) of the servers that is running PostgreSQL servers in the local network. Is there some methods in libpq or libpqxx ? Regards Devara Gudda
Raviprakash
  • 2,410
  • 6
  • 34
  • 56
1
vote
1 answer

postgresql client library for Lazarus Pascal - missing libpq.dll error

I'm trying to create my first application with Lazarus Pascal and PostgreSQL. The pg database is on my Ubuntu Linux host. Lazarus is on XP, running through VirtualBox. When trying to make a connection to the PG database, I get an error that…
itsols
  • 5,406
  • 7
  • 51
  • 95
1
vote
3 answers

PostgreSQL libpq "Integer out of range" error when sending integer as binary

I'm attempting to insert some integers into a Postgres table with the following somewhat simple code. #include #include #include int main() { int64_t i = 0; PGconn * connection = PQconnectdb(…
Edward
  • 1,786
  • 1
  • 15
  • 33
1
vote
0 answers

How do I fix libcrypto?

I made the mistake of copying the libcrypto.* files from /Library/PostgreSQL/9.2/lib to /usr/lib because I was getting errors from Psycopg2 saying it needed 1.0.0 and I only had 0.9.8 or something along those lines and now, I'm stuck with the…
user1086337
  • 387
  • 1
  • 7
  • 19
1
vote
3 answers

PostgreSQL consuming large amount of memory for persistent connection

I have a C++ application which is making use of PostgreSQL 8.3 on Windows. We use the libpq interface. We have a multi-threaded app where each thread opens a connection and keeps using without PQFinish it. We notice that for each query (especially…
sivabudh
  • 31,807
  • 63
  • 162
  • 228