Re: Connection string

From: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: "Michael Meskes" <meskes(at)postgresql(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Connection string
Date: 2006-08-13 05:58:54
Message-ID: d86a77ef0608122258vcaed7em7560e3278b6cd07d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)dhaliwal01(at)gmail(dot)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(at)fuhr(dot)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
> >
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-08-13 06:19:08 Re: Connection string
Previous Message Harpreet Dhaliwal 2006-08-13 05:50:13 Re: Connection string