I've done a couple of tests and in all my tests I see no problems with
multiline error messages.
Also, if I read your original post right, yuou're seeing the problem in
a program that does a simple "PQconnectdb()" to a server that's not
running, in which case the normal errormsg-from-backend routines are
definitly not involved. it looks more like "random errors" to me.
Do you see this problem if you use the psql.exe command to connect to
the very same machine? Since psql.exe uses libpq, if it works there,
then it's not "deep inside libpq" at least.
It looks like you are using Borland C++ to compile your program, right?
Could you try the same program compiled with the MingW compiler? It
could be that your import library is somehow incorrect (say bad function
calling conventions, bad function ordering or something), which would
lead to strange errors.
Your simple test program from
http://archives.postgresql.org/pgsql-interfaces/2005-05/msg00044.php
works just fine in my installation - it doesn't do anything, but it
doesn't crash either. Compiled with MingW that is, I don't have Borland
to test with. And with manual linking and not the #pragma link, because
that appears to be a Borlandism.
//Magnus
>Is there any easy (ie, no C postgres functions) way to generate
>multi-line error messages so that I can explore that possibility?
>
>Gustavo Lopes
>
>On 20/05/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Gustavo Lopes <contratempo@gmail.com> writes:
>> > Actually it seems the hints are not the problem. I see no
>pattern now.
>> > For instance, if table "j" doesn't exist, "drop table j"
>is ok but not
>> > "drop table".
>>
>> Well, the latter generates a syntax complaint:
>>
>> regression=# drop table j;
>> ERROR: table "j" does not exist
>> regression=# drop table ;
>> ERROR: syntax error at or near ";" at character 12
>> LINE 1: drop table ;
>> ^
>> regression=#
>>
>> Maybe the pattern is "any multi-line error message causes a problem"?
>>
>> regards, tom lane
>>
>
>---------------------------(end of
>broadcast)---------------------------
>TIP 9: the planner will ignore your desire to choose an index
>scan if your
> joining column's datatypes do not match
>