Re: Connection string

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Harpreet Dhaliwal <harpreet(dot)dhaliwal01(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Connection string
Date: 2006-08-10 23:16:59
Message-ID: 20060810231658.GA19362@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 10, 2006 at 11:57:14AM -0400, Harpreet Dhaliwal wrote:
> EXEC SQL CONNECT TO 'tcp:postgresql://192.168.0.123/xyz' USER jsb

It should work if you omit the quotes or use a variable reference.
Try this:

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

or

EXEC SQL BEGIN DECLARE SECTION;
char *connstr = "tcp:postgresql://192.168.0.123/xyz";
EXEC SQL END DECLARE SECTION;

EXEC SQL CONNECT TO :connstr USER jsb;

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Phillip Smith 2006-08-10 23:59:00 Re: Unable to connect to PostgreSQL 8 from PGAdmin III
Previous Message Jasbinder Bali 2006-08-10 21:27:55 Re: Unable to connect to PostgreSQL 8 from PGAdmin III