pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bosco Rama <postgres@boscorama.com>
To: pgsql-interfaces@postgresql.org
Subject: ecpg 'set' failure using host vars
Date: Fri, 15 Aug 2008 20:47:49 -0700
Message-ID: <48A64DE5.4000906@boscorama.com> (raw)

Hi,

I've been using the following set statement just fine under versions
prior to 8.3.3:

   exec sql char *sm;
   ...
   sm = "myschema";	// This may not always be constant
   ...
   exec sql set search_path to :sm;

However, a recent upgrade from 8.2.7 to 8.3.3 (on FC9) caused the
'set' statement to suddenly start throwing the dreaded error:

ERROR: syntax error at or near "$1" in line 13256

Running in debug output mode we are seeing the following:

[22245]: ecpg_execute line 13256: QUERY: set search_path to  $1  with 1 parameter on connection ecpgconn
[22245]: ecpg_execute line 13256: using PQexecParams
[22245]: free_params line 13256: parameter 1 = myschema
[22245]: ecpg_check_PQresult line 13256: Error: ERROR:  syntax error at or near "$1"
LINE 1: set search_path to  $1
                             ^

When the schema is replaced by a literal it works just fine, thusly:
    exec sql set search_path to myschema;

Did we miss something in the porting between versions?

Any help would be greatly appreciated.

Bosco.



view thread (9+ messages)  latest in thread

Message-ID: <48A64DE5.4000906@boscorama.com>
Permalink:  ../48A64DE5.4000906@boscorama.com/
Also on:    postgresql.org/message-id/48A64DE5.4000906@boscorama.com

 · 

reply

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: postgres@boscorama.com
  Subject: Re: ecpg 'set' failure using host vars
  In-Reply-To: <48A64DE5.4000906@boscorama.com>

* 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