Re: ecpg 'set' failure using host vars
Michael Meskes <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.interfaces |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected] Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL! -- Sent via pgsql-interfaces mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-interfaces
ecpg_set.diff
(text/x-diff, 558 B)
--- 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; }
;