Re: Connection string - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Connection string
Date
Msg-id 20060810231658.GA19362@winnie.fuhr.org
Whole thread Raw
In response to Re: Connection string  ("Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com>)
List 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

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: my first procedure
Next
From: "Merlin Moncure"
Date:
Subject: Re: my first procedure