Re: [GENERAL] Linking against static libpq using Visual C++

2011-03-31 Thread Julia Jacobson
Hi, Although I finally managed to build libpq using Visual C++, I'm continuously experiencing problems with this IDE. Therefore I switched to MinGW and it was indeed easy to compile libpq with it from the first time on. However, I'm experiencing the same problem as discussed on

[GENERAL] Linking against static libpq using Visual C++

2011-02-27 Thread Julia Jacobson
Dear PostgreSQL community, When trying to compile c++ code including libpq against the static version libpq.lib, Visual Studio 2010 gives me the following errors: 1main.obj : error LNK2019: Unresolved external reference __imp__exit in Funktion _main. 1libpq.lib(fe-connect.obj) : error

Re: [GENERAL] Linking against static libpq using Visual C++

2011-02-27 Thread Julia Jacobson
Thanks for your answer. I was indeed using the static libpq version from the installer. I tried to compile my own one with Visual Studio 2010, but this caused a lot of problems due to the fact that Visual Studio 2010 has changed the manifest tool. So I built a static version using Visual C++

Re: [GENERAL] Linking against static libpq using Visual C++

2011-02-27 Thread Julia Jacobson
Thanks again for your answer. For all those experiencing similar problems, the missing libraries were: 1) ws2_32.lib 2) secur32.lib (for the SSPI functions) My code is compiled now without errors, but it seems to contain a buffer overflow. So there's still some work left for me ... On Sun, Feb

Re: [GENERAL] Linking against static libpq using Visual C++

2011-02-27 Thread Julia Jacobson
My application looks like this: #include iostream #include libpq-fe.h using namespace std; int main(void) { PGconn *conn; const char *info = hostaddr = 'postgres.server.com' \ port = '5432' \ dbname = 'mydb' \ user

Re: [GENERAL] Linking against static libpq using Visual C++

2011-02-27 Thread Julia Jacobson
Okay, I could fix it by myself now: One has to tell Visual C++ to ignore msvcrt.lib. A warning message during the compilation of my code already lamented a conflict between msvcrt and the included libraries. I should have taken it for serious instead of just ignoring it. So now everything works

[GENERAL] SELECT INTO array[i] with PL/pgSQL

2011-02-07 Thread Julia Jacobson
Dear PostgreSQL community, Please consider the following minimal example: CREATE TABLE example (row_id SERIAL, value TEXT); INSERT INTO example(value) VALUES ('val1'); INSERT INTO example(value) VALUES ('val2'); INSERT INTO example(value) VALUES ('val3'); CREATE OR REPLACE FUNCTION foo()

[GENERAL] Subquery for column names of tablefunc crosstab queries

2011-01-21 Thread Julia Jacobson
Hello everybody out there familiar with the tablefunc module, Having read the documentation of the tablefunc module, I'm wondering whether it is possible to get the values for the names of the columns for the crosstab query from a subquery. A minimal example would look like this: CREATE TABLE

Re: [GENERAL] Subquery for column names of tablefunc crosstab queries

2011-01-21 Thread Julia Jacobson
the name of the column but of course also a data type (always the same - int). Is it possible for a newbie to solve my problem by a user-defined function in PL/pgSQL or is it rather complicated? On 01/21/2011 16:08, Joe Conway wrote: On 01/21/2011 05:48 AM, Julia Jacobson wrote: Having read

Re: [GENERAL] Crosstab query on huge amount of values

2011-01-17 Thread Julia Jacobson
Am 17.01.2011 00:20, schrieb Steve Litt: On Sunday 16 January 2011 17:40:34 Julia Jacobson wrote: Hello everybody out there using PostgreSQL, A table with the results of students in different exams student | date_of_exam | grade -- Peter | 2010-09-09 | 2 Tom

[GENERAL] Crosstab query on huge amount of values

2011-01-16 Thread Julia Jacobson
Hello everybody out there using PostgreSQL, A table with the results of students in different exams student | date_of_exam | grade -- Peter | 2010-09-09 | 2 Tom | 2010-09-09 | 1 Andy| 2010-09-21 | 3 Tom | 2010-09-21 | 4 Peter | 2010-09-21 |

[GENERAL] SELF LEFT OUTER JOIN = SELF JOIN including NULL values

2010-09-17 Thread julia . jacobson
Hello everybody out there using PostgreSQL, After having read the official documentation and having done extensive web search, I'm wondering how to perform something like a SELF LEFT OUTER JOIN in PostgreSQL, i.e. a SELF JOIN on a table containing NULL values in one of the columns to join.

[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

[GENERAL] psql '\copy' command for writing binary data from BYTEA column to file

2010-09-04 Thread Julia Jacobson
Hello everybody out there using PostgreSQL, One of the tables in my database contains pictures in jpeg format in a column of the type BYTEA. I have written a script in Python for inserting pictures into the database as well as exporting them from the database later. It works fine. When running