[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 stdlib.h #include stdio.h #include iostream #include fstream #include libpq-fe.h using namespace std; main () { PGconn

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

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 julia.jacob...@arcor.de 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 stdlib.h #include stdio.h #include iostream