Re: Connection string - Mailing list pgsql-general

From Harpreet Dhaliwal
Subject Re: Connection string
Date
Msg-id d86a77ef0608122258vcaed7em7560e3278b6cd07d@mail.gmail.com
Whole thread Raw
In response to Re: Connection string  ("Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com>)
Responses Re: Connection string  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Also,
-402 sqlcode means "connection attempt to the database did not succeed"

does this mean that my application is connecting to the database server but somehow failing in connecting to the database dbxyz due to some authentication problems???

~Harpreet

On 8/13/06, Harpreet Dhaliwal < harpreet.dhaliwal01@gmail.com> wrote:
Hello,

I'm really not able to connect to my database server.

Let me explain the whole thing once again so that I don't miss telling anything.

I have a user account jsb that owns directory /usr/local/pgsql/jsb
initdb is done on the same directory i.e. /usr/local/pgsql/jsb

So all the db related files are in the same directory.

Now there is a dabatase dbxyz created using pgadmin3 and user/profile jsb is the owner of
this database, which is again set using pgadmin3 only.

Now, in the machine (where all my middle tier programs would reside), I have a .pgc using which i am trying to connect to the Database server whose IP address is 192.168.0.123.

Also, in postgresql.conf file, I have set listen_address='*' and port = 5432.

Now, i have a test.pgc file whose contents are as follows:
---------------------------------------------------------
---------------------------------------------------------
#include <stdio.h>
EXEC SQL INCLUDE sqlca;


int main()
{
    EXEC SQL BEGIN DECLARE SECTION;
         char abc[20];
    EXEC SQL END DECLARE SECTION;

    EXEC SQL CONNECT TO tcp:postgresql://192.168.0.123:5432/dbxyz USER jsb;

   printf("Error code is %d \n", SQLCODE);

}

-------------------------------------------------------------------
-------------------------------------------------------------------

Here User jsb is used because jsb owns database xyz and the database directory /usr/local/pgsql/jsb aswell

I always get error code -402.

I don't know where am i going wrong or what extra i need to do.
My deadline is approaching very close and I'm feeling baffled now coz i don't think so there's anything more i can do, not something in my knowledge.

A prompt and quick help would be greatly and deeply appreciated.

Thanks and regards,
harpreet


On 8/12/06, Michael Fuhr < mike@fuhr.org> wrote:
On Fri, Aug 11, 2006 at 11:40:53PM -0400, Harpreet Dhaliwal wrote:
> What kind of patch are you talking about?

A documentation patch.  Michael Meskes, to whom I was responding,
maintains ECPG.  I was asking whether he wanted me to submit a patch
to fix misleading parts of the documentation or whether he'd commit
the necessary changes based on what we've already discussed in this
thread.

--
Michael Fuhr


pgsql-general by date:

Previous
From: "Harpreet Dhaliwal"
Date:
Subject: Re: Connection string
Next
From: Richard Broersma Jr
Date:
Subject: Re: Connection string