From: Michael Meskes <meskes@postgresql.org>
To: Bosco Rama <postgres@boscorama.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ecpg 'set' failure using host vars
Date: Tue, 19 Aug 2008 12:31:18 +0200
Message-ID: <20080819103118.GA23760@feivel.credativ.de> (raw)
In-Reply-To: <48A64DE5.4000906@boscorama.com>
References: <48A64DE5.4000906@boscorama.com>
On Fri, Aug 15, 2008 at 08:47:49PM -0700, Bosco Rama wrote:
> exec sql char *sm;
> ...
> sm = "myschema"; // This may not always be constant
> ...
> exec sql set search_path to :sm;
Could you please try the attached patch and tell me whether it works for you? I will then check this in into 8.3 so that the next stable release works again as it should.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!
Attachments:
[text/x-diff] ecpg_set.diff (557B, ../20080819103118.GA23760@feivel.credativ.de/2-ecpg_set.diff)
download | inline diff:--- pgsql-ecpg/preproc/preproc.y 2008-08-18 16:56:11.000000000 +0200+++ pgsql/src/interfaces/ecpg/preproc/preproc.y 2008-08-19 12:29:28.000000000 +0200@@ -1247,7 +1247,16 @@
;
var_value: opt_boolean { $$ = $1; }
- | AllConst { $$ = $1; }+ | AllConst { /* we have to check for a variable here because it has to be+ replaced with its value on the client side */+ if ($1[1] == '$')+ {+ $$ = make_str("$0");+ free($1);+ }+ else+ $$ = $1;+ }
| ColId { $$ = $1; }
;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: meskes@postgresql.org, postgres@boscorama.com
Subject: Re: ecpg 'set' failure using host vars
In-Reply-To: <20080819103118.GA23760@feivel.credativ.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox