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
0
votes
0 answers

postgresql libpq C function with parameters

I developed a function plpgsql that takes in an xml argument, parses the xmls and inserts into corresponding tables. It returns void after it finishes. I can co select functionname('xml string'); This will parse 'xml string' and insert into the…
KartDev
  • 75
  • 2
  • 8
0
votes
2 answers

error in installing libpq-dev in ubuntu 14.04 after installing psycopg2

I am trying to install all requirements of a project so i run the command pip install -r requirements.txt but it gives the error Downloading/unpacking psycopg2==2.6 (from -r requirements.txt (line 58)) Downloading psycopg2-2.6.tar.gz (367kB):…
Amrit
  • 2,115
  • 1
  • 21
  • 41
0
votes
1 answer

Postgres COPY FROM data formatting before insertion

I'm creating PostgreSQL database client that ought to work as substitute for SQL Server client. Both clients are written in C++. One of the supported operation is bulk copy from given instance of class containing std::string ReadChunk() method. For…
SzymonPajzert
  • 692
  • 8
  • 18
0
votes
1 answer

libpq : get binary date

Im using libpq and I'm getting the data in binary format. I correctly received timestamp data and basic formats (float, int, long and such). But, I'm not able to understand DATEOID format, and I was not able to find any clue in the…
diego.martinez
  • 1,051
  • 2
  • 11
  • 25
0
votes
1 answer

Correct psql COPY command for transferring table data?

I am writing some c code to transfer data from database_1, table_1 to database_2, table_2. I am quite new to postgresql and unable to figure out how to do this. I am using postgres-9.5 Is the below syntax correct? psql database_1 -c 'COPY table_1 TO…
user5993203
0
votes
1 answer

How to do this linux command in windows?

Basically I'm trying to install libpq-dev but I've only found ways to do it in Linux. I've tried to install Cygwin but it takes quite a long time here at work, I currently don't have permanent internet connection at home, so I can't download at…
Joshua Rajandiran
  • 2,788
  • 7
  • 26
  • 53
0
votes
0 answers

libpq c postgres interface crash

I'm a IT student doing some C postgres interface. Using codelite I'm doing the following on a win10 machine: compile settings .include path : ".../postgresql/../include" and I've changed the backslashes from \ to / link settings .library search…
Cristian
  • 19
  • 8
0
votes
2 answers

How build 64-bit version of libpq from source code?

I'm trying connect to PostgreSQL from C-code, and i have to build libpq from source, because i'm on AIX. I followed the steps in this comment Where do i get libpq source? but in result i got a 32-bit version of libpq.a, how build 64-bit version?
0
votes
1 answer

c++ connection to postgres always segfaults

I can't get libpqxx working with a basic query. It always segfaults. I'm currently using a class to facilitate the connection. //nearestLoc.h class databaseConnection{ public: databaseConnection(); ~databaseConnection(); void…
Anisotropic
  • 635
  • 9
  • 21
0
votes
0 answers

Connect to Postgres over UNIX socket running under root

I'm trying to connect to Postgres in a C program using libpq. When I'm running under my own username (which is the same as the username I've created for my Postgres database) everything is fine. When I try to run the program under root it fails…
Elektito
  • 3,863
  • 8
  • 42
  • 72
0
votes
1 answer

Node.js (node-pg) or C (libpq) - perform PostgreSQL request without waiting for response?

For efficiency and not to consume the pool of PostgreSQL I want to execute some requests and not wait for them to respond or fail. 100% of the requests are heavy failsafe (internal error catching) functions that return VOID, and I want to be able to…
Onza
  • 1,710
  • 4
  • 18
  • 31
0
votes
1 answer

libpq: which lib files should I use

I used the PostgreSQL as my data base and I am coding a c++ project, so I have to use the libpq to connect it. I have already found the include file and lib file in the PostgreSQL file but there are too many files. I think I don't need to add them…
Yves
  • 11,597
  • 17
  • 83
  • 180
0
votes
0 answers

PostgreSQL making winsock TCP recv command incredibly slow

I am writing a piece of C based software using Visual C++ 2008 Express. The software has a database POSTGRESQL 9.4 and multiple TCP sockets (both Server and Client). The sockets are created by the method on this link.…
Display Name
  • 1,025
  • 2
  • 15
  • 34
0
votes
0 answers

Can't compile libpq-fe.h no such file or dir on cpp

I tried to compile source that using libpq-fe.h as header. This is my header #ifndef UTIL_H #define UTIL_H #include "libpq-fe.h" using namespace std; I compiled this with make command, and it gives me error #include "libpq-fe.h" no such file or…
Sonic Master
  • 1,238
  • 2
  • 22
  • 36
0
votes
1 answer

How does 'client_min_messages' setting affect an application using libpq?

From postgres documentation, client_min_messages (enum) Controls which message levels are sent to the client. Valid values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, LOG, NOTICE, WARNING, ERROR, FATAL, and PANIC. Each level includes all the levels…
svr
  • 137
  • 7