Can you give an example of inserting binary data in PostgreSQL database from remote machine using libpq. My second question is: Is there any other API more efficient than libpq with C++. Thanks
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
There are 2 types of blobs in PostgreSQL — For BYTEA you'd use something like this in libpq:
|
|||
|
Using libpqxx is the C++ way to do it, while libpq is the C API. Here is a full example of how to do it using pqxx: How to insert binary data into a PostgreSQL BYTEA column using the C++ libpqxx API? In short, the relevant C++ lines using libpqxx look like this:
|
|||||
|