Re: [GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Diego Schulz
On Tue, Sep 14, 2010 at 6:01 PM, Julia Jacobson wrote: > Hello everybody out there using PostgreSQL, > > What is the problem with the following C++ code for the extraction of data > from a BYTEA column to a binary file? > > #include > #include > #include > #include > #include "libpq-fe.h" > us

Re: [GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Daniel Verite
Julia Jacobson wrote: > ofstream myFile ("picture.jpg", ios::out | ios::binary); > myFile.write (contents); You must specify the number of bytes to write. Best regards, -- Daniel PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org -- Sent via pgsql-general

[GENERAL] Extracting data from BYTEA column to binary file using libpq

2010-09-14 Thread Julia Jacobson
Hello everybody out there using PostgreSQL, What is the problem with the following C++ code for the extraction of data from a BYTEA column to a binary file? #include #include #include #include #include "libpq-fe.h" using namespace std; main () { PGconn *conn; conn = PQconnectdb("hosta