Re: libpq on windows

From: Gustavo Lopes <contratempo(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq on windows
Date: 2005-05-22 17:48:13
Message-ID: 2b5c484b0505221048df0df71@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sollentuna(dot)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(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Gustavo Lopes <contratempo(at)gmail(dot)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
> >
>

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Clay, Bruce 2005-05-27 15:58:10 Fw: PgOleDb / PostGis / PostgreSql interface problem
Previous Message John DeSoi 2005-05-22 13:27:05 Re: MacOS Interface ?