Re: Connection string

From: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Connection string
Date: 2006-08-10 04:02:24
Message-ID: d86a77ef0608092102l179b8c7epcd4f4497dafa8e5c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi
I already read that documentation.

My ECPG code for connecting to the DB server is:

EXEC SQL CONNECT TO 192.168.1.100:/xyz

i also tried

tcp:postgresql://192.168.1.100[:*port*][/*dbname*][?*options*]

unix:postgresql://*192.168.1.100*[:*port*][/*dbname*][?*options*]

but unfortunately it say DB doesn't exist.

I don't know the right way to use IP addresses while connecting to a
postgres DB using ECPG.

On 8/9/06, Michael Fuhr <mike(at)fuhr(dot)org> wrote:
>
> On Wed, Aug 09, 2006 at 11:02:00AM -0400, Harpreet Dhaliwal wrote:
> > I'm trying to connect to postgres database in a distributed
> environment,
> > say from machine X to Machine Y (Machine Y has postgres DB)
> > How should my connection string look like in a program in Machine X.
> >
> > EXEC SQL CONNECT TO ------??? (Do i need to specify the IP of DB
> server?)
> > I tried a few options but nothing works.
>
> This appears to be ECPG so see "Connecting to the Database Server"
> in the ECGP chapter of the documentation:
>
> http://www.postgresql.org/docs/8.1/interactive/ecpg-connect.html
>
> If the documentation and examples don't help then please post exactly
> what you've tried and what happened (complete error message, etc.).
>
> --
> Michael Fuhr
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-08-10 04:06:05 Re: Too many open files from postgres.
Previous Message Tom Lane 2006-08-10 04:01:41 Re: Accessing Database Data from C Function