Can't get ECPG to connect (was Re: Urgen help required) - Mailing list pgsql-general

From Bill Moran
Subject Can't get ECPG to connect (was Re: Urgen help required)
Date
Msg-id 20061018081506.a4af0c8b.wmoran@collaborativefusion.com
Whole thread Raw
In response to Urgen help required  ("J S B" <jsbali@gmail.com>)
Responses Re: Can't get ECPG to connect (was Re: Urgen help required)  ("Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com>)
List pgsql-general
In response to "J S B" <jsbali@gmail.com>:

> Hi,
> I have the following scenario:-
>
> 1. There's a function in the postgres datbase that when executed calls a
> shared object (dynamically loaded).
> 2. The shared object is a Client (made using socket library) which connects
> to a server (coded again using socket library) hosted on some other machine.
> 3. This server when invoked through the postgres function described above
> has an ECPG code in it that gets executed after a successful write back to
> the client, which inserts a record in a table in the postgres database.
>
> I use ECPGdebug in the begening of the server code file to see the state of
> affairs with the ECPG code and it always raises -402 sqlcode which means the
> connection attempt to the database did not succeed.
>
> All firewalls in the datbase server and this machine wherein my socket
> server is running are disabled.
> Other function calls from this machine to my database machine are working
> fine.
>
> Also, my postgres function is able to establish connection with the this
> outside deamon (that i refer to as server coded using socket library).
> Just the ECPG calls from this deamon back to postgres database are not
> successful.
>
> Any kind of help would be highly appreciated.

How about help posting a better question.

First off, use a descriptive subject.  Notice how I've improved this for
you.

Secondly, always cut/paste exact error messages.  There are some people
who will quickly know exactly what is wrong if they see the whole error
message.

Thirdly, have a look in the PostgreSQL server logs.  If there's nothing
telling there, bump up the authentication/connection debugging in
postgresql.conf and try again.  If you get messages but aren't sure what
they mean, post them to the list.

Fourthly, be more specific.  It would be worthwhile to show the snippit
of code that connects, so people know whether you're using IP sockets are
unix domain sockets.

Fifthly, are you using unix domain sockets or IP sockets?  And are the
appropriate permissions in pg_hba.conf?

--
Bill Moran
Collaborative Fusion Inc.

pgsql-general by date:

Previous
From: Shane Ambler
Date:
Subject: Re: COPY FROM STDIN instead of INSERT
Next
From: Berend Tober
Date:
Subject: Re: Is Postgres good for large Applications