Re: libpq on windows - Mailing list pgsql-interfaces

From Gustavo Lopes
Subject Re: libpq on windows
Date
Msg-id 2b5c484b0505221048df0df71@mail.gmail.com
Whole thread Raw
In response to Re: libpq on windows  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-interfaces
There were no problems with the executables when I compiled them with MingW.
I've also been able to compile working executables with VC++ by using
the /MD option  - link with msvcrt  runtime library, which MingW and
libpq.dll also use (I found this by accident).
While this really mitigates my problem (I am able to build working
executables), this behaviour is still a mystery to me so any comments
would be appreciated.

Gustavo Lopes

On 22/05/05, Magnus Hagander <mha@sollentuna.net> wrote:
> 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
> >
>


pgsql-interfaces by date:

Previous
From: John DeSoi
Date:
Subject: Re: MacOS Interface ?
Next
From: "Clay, Bruce"
Date:
Subject: Fw: PgOleDb / PostGis / PostgreSql interface problem