Re: ECPG could not connect to the database.

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Artur Pietruk <arturp(at)plukwa(dot)pdi(dot)net>
Cc: Joachim Jaeckel <Joachim(dot)Jaeckel(at)coffeebreak(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: ECPG could not connect to the database.
Date: 2001-01-03 10:09:49
Message-ID: 20010103110949.A3426@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jose Luis LG 2001-01-03 10:52:00 ER Modeling tool
Previous Message drevil 2001-01-03 10:00:48 Sources of randomness in PG?