X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E22425280D for ; Sun, 22 May 2005 14:47:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26414-03 for ; Sun, 22 May 2005 17:47:30 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by svr1.postgresql.org (Postfix) with ESMTP id 3466952868 for ; Sun, 22 May 2005 14:47:28 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 69so567965wri for ; Sun, 22 May 2005 10:48:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Tvws3MmKko265eFk2rf4q26cxNMCyRUOieAbJ9Pyh+Y44T0glIkUJSmFNMCOG6tgJIosR7ejD48FdnQHH2eutxsbEUZIlCxYYhIlzY3sTquBXed+5YgvHN8ezMJpBlYPBBr619foOhDjJElGLa+L7F2jk6z9s28yTDqhL8xRQQE= Received: by 10.54.27.65 with SMTP id a65mr3353482wra; Sun, 22 May 2005 10:48:13 -0700 (PDT) Received: by 10.54.3.70 with HTTP; Sun, 22 May 2005 10:48:13 -0700 (PDT) Message-ID: <2b5c484b0505221048df0df71@mail.gmail.com> Date: Sun, 22 May 2005 18:48:13 +0100 From: Gustavo Lopes Reply-To: Gustavo Lopes To: pgsql-interfaces@postgresql.org Subject: Re: libpq on windows In-Reply-To: <6BCB9D8A16AC4241919521715F4D8BCE6C7509@algol.sollentuna.se> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <6BCB9D8A16AC4241919521715F4D8BCE6C7509@algol.sollentuna.se> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.273 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/59 X-Sequence-Number: 5562 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 wrote: > I've done a couple of tests and in all my tests I see no problems with > multiline error messages. >=20 > 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. >=20 > 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. >=20 > 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. >=20 > 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. >=20 > //Magnus >=20 >=20 > >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 wrote: > >> Gustavo Lopes 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=3D# drop table j; > >> ERROR: table "j" does not exist > >> regression=3D# drop table ; > >> ERROR: syntax error at or near ";" at character 12 > >> LINE 1: drop table ; > >> ^ > >> regression=3D# > >> > >> 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 > > >