Questions tagged [libpqxx]

Libpqxx is a C++ client API for PostgreSQL, the enterprise-strength open-source database software.

Libpqxx is a C++ client API for PostgreSQL, the enterprise-strength open-source database software.

homepage: http://pqxx.org/development/libpqxx/

Other PostgreSQL C++ clients: https://wiki.postgresql.org/wiki/Client_Libraries#C.2B.2B

235 questions
4
votes
1 answer

postgresql libpqxx Several queries as one transaction

Is it possible to execute one transaction contains several queries, for example insert smth in table1 and insert smth in table2? How I can implement this? I use libpqxx to interact the database and expect an answer relating to that. Thank you.
Ir S
  • 445
  • 1
  • 6
  • 19
4
votes
2 answers

How can I get values from array using libpqxx?

How can I get values from array using libpqxx? For Example I have table like this: CREATE TABLE testTable ( testArray integer[] ); How do I get int array with these values in C++?
ktoś tam
  • 739
  • 1
  • 6
  • 11
4
votes
3 answers

C++, Postgres , libpqxx huge query

I have to execute an SQL query to Postgres by the following code. The query returns a huge number of rows (40M or more) and has 4 integer fields: When I use a workstation with 32Gb everything works but on a 16Gb workstation the query is very slow…
Alexandros
  • 2,160
  • 4
  • 27
  • 52
4
votes
1 answer

How to get after executing INSERT into database fetch id of inserted row?

I am using c++11 and pqxx to access postgresql database and I need id of inserted row and flag if it was successful or not. How to get after executing INSERT into database fetch id of inserted row ? I have tried to find example on net but without…
PaolaJ.
  • 10,872
  • 22
  • 73
  • 111
4
votes
3 answers

Why is this simple libpqxx code leaking memory?

Recently I wrote an application that accesses a Postgres DB via libpqxx, and it leaks memory badly. Even this simple test program, which is based on the example at http://pqxx.org/devprojects/libpqxx/doc/4.0/html/Reference/a00001.html leaks like no…
Geoff
  • 83
  • 2
  • 7
4
votes
2 answers

Libpqxx connection pool

I am trying to develop a very simple and straightforward connection pool using the libpqxx library. I am quite new to c++ and still very confused with pointers and referencing. The behaviour of the class is very simple: have a vector with some…
JoaoFLF
  • 91
  • 1
  • 5
3
votes
2 answers

Efficiently iterating through a database row (libpqxx), assigning values to a struct

I'm grabbing a row from a database using libpqxx and assigning the fields within the pqxx::row to a struct specifically designed to hold those values: struct driveOperationRecord { long int id = 0; long int drive_operator_id = 0; long…
3
votes
3 answers

Bulk loading of data with libpqxx

I need to bulk load a large amount of data (about 7.000.000 entries) into a PostgreSQL database using libpqxx. I have read the documentation on how to populate the database, but I am not sure on how to use this in my case. First I cannot use files,…
LiKao
  • 10,408
  • 6
  • 53
  • 91
3
votes
0 answers

How can I define a new C++ type conversion so that libpqxx will know how to convert that type?

Stuff Used: Windows 10 libpq:x64-windows 9.6.1-7 libpqxx:x64-windows 6.4.4 MSVC Compiler My Code: #include #include…
Ojav
  • 678
  • 6
  • 22
3
votes
1 answer

How can I bind NULL value in libpq with C++?

I can't bind NULL value for a numeric type in C++ with libpq library. I use this description How to prepare statements and bind parameters in Postgresql for C++ and it worked fine. But I couldn't find out how to bind a NULL value for a numeric…
Tomtom
  • 45
  • 7
3
votes
1 answer

Error in ./configure step in installation of libpqxx

this is a bit of a long shot but: I'm following this guide: https://www.tutorialspoint.com/postgresql/postgresql_c_cpp.htm But when running ./configure I get the following error: (previous checking lines omitted for brevity) checking for main in…
PeterOeClausen
  • 370
  • 3
  • 15
3
votes
3 answers

Error while compiling libpqxx code example?

I am trying to compile libpqxx code example: #include #include int main(int, char *argv[]) { pqxx::connection c("dbname=company user=accounting"); pqxx::work txn(c); pqxx::result r = txn.exec( "SELECT id " …
user2856064
  • 541
  • 1
  • 8
  • 25
3
votes
1 answer

How to use libpqxx to receive notifications from the PostgreSQL database?

I'm writing C++ applicatoin which needs to receive notifications for data changes from PostgreSQL through libpqxx library. But it's tutorial doesn't include such use case. The notifications must be received on multiple channels. Also I'm using…
bobeff
  • 3,543
  • 3
  • 34
  • 62
3
votes
1 answer

Error when attempting to compile libpqxx-4.0.1 on Solaris 10 using Oracle Solaris Studio 12.3

Problem description I am unable to compile libpqxx-4.0.1 on Solaris 10 using Solaris Studio 12.3. Background The first thing I did when I needed libpqxx was to search for it in OpenCSW using /opt/csw/bin/pkgutil -a libpqxx. However, the package in…
3
votes
1 answer

libpqxx: How to reconnect to a Postgresql database after connection process has died

I instantiate a PostgreSQL connection through libpqxx. I query the database and get correct response. After that I tried the following error case: after instance of pqxx::connection has been created, I pause my program, manually kill the Postgre's…
0xC0DEGURU
  • 1,432
  • 1
  • 18
  • 39
1
2
3
15 16