Re: ECPG could not connect to the database. - Mailing list pgsql-general

From Michael Meskes
Subject Re: ECPG could not connect to the database.
Date
Msg-id 20010103110949.A3426@feivel.fam-meskes.de
Whole thread Raw
In response to Re: ECPG could not connect to the database.  (Artur Pietruk <arturp@plukwa.pdi.net>)
Responses Re: ECPG could not connect to the database.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Jan 03, 2001 at 01:20:43AM +0100, Artur Pietruk wrote:
> > try to make a connection to my database, I get the following error at
> > runtime:
> ...
>     I'm sorry that I am answering that question after a month, but i
> did not see someone solving your problem.

I did. But I had private conversation with Joachim instead of using the
list.

>     First of all - you have done everything right with your code. You

Apparently this was not the case.

> simply rediscovered a long standing ECPG BUG, which was introduced years

Interesting. I do not know about this special bug. I have to admit there are
some outstanding bugs that I won't be able to fix before 7.1 comes out, but
this one is new to me.

Anyone willing to spend some time digging the hostname problem? That is why
ecpg programs need to specify a hostname and not an IP number to connect,
while psql for instance works with both?

> ago in PostgreSQL 6.4 (or was it 6.3?). This bug was reported here by me
> and other people, we had found where is the problem and how to work around
> this ;) (Hi developers... I hope that you are reading this... Maybe it's
> about the time to fix it...? :))).

Would be interesting to know the version number of ecpg you are talking
about.

>     ECPG is generating wrong code. Try to generate *.c file by ecpg,
> and look at the generated "ECPGconnect". In my case that line looks like this:

I just ran test1.pgc from the source tree through ecpg 2.8.0 and then
grepped for ECPGconnect:

...
        { ECPGconnect(__LINE__, "mm" , NULL,NULL , "main", 0);
        strcpy(msg, "connect");
        { ECPGconnect(__LINE__, "pm" , NULL,NULL , NULL, 0);
...

Just for curiosity I also tried ecpg 2.7.1 which comes with 7.0.3:

...
    { ECPGconnect(__LINE__, "mm" , NULL,NULL , "main", 0);
        strcpy(msg, "connect");
        { ECPGconnect(__LINE__, "pm" , NULL,NULL , NULL, 0);
...

>   { ECPGconnect(__LINE__, NULL, "biblioteka" , NULL ,NULL, 0);}

So this of course brings me to wonder which version you are using.

>     But that is wrong, it should look like this:
>
> --8<--
>   { ECPGconnect(__LINE__, "biblioteka" , NULL , NULL ,NULL, 0);}
> --8<--

As it does.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

pgsql-general by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: RE: Re: MySQL and PostgreSQL speed compare
Next
From: "Gregory Wood"
Date:
Subject: Re: RE: Re: MySQL and PostgreSQL speed compare