Re: BUG #4550: ecpg problem with copy command and hostvar

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Clemens Fischer <cfi(at)mbs-software(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4550: ecpg problem with copy command and hostvar
Date: 2008-11-26 13:49:48
Message-ID: 20081126134948.GB12021@feivel.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 25, 2008 at 12:28:38PM +0000, Clemens Fischer wrote:
> The copy command can't be used with a hostvar.

This is essentially the answer. The major difference between the ecpg version
of PostgreSQL 8.2 and 8.3 is that the 8.3 version uses the backend supplied
prepare/execute facility instead of just simulating this feature. Part of this
change was to change the variable handling and no longer construct strings on
the client side but pass the variables to the backend directly. But there is no
way to pass a variable filename for the copy command AFAIK. Or in other words,
the old versions had a bug in that they accepted a variable there.

Can you use EXECUTE and put the whole statement into a variable instead?

Michael

--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Clemens A. Fischer 2008-11-26 13:56:33 Re: BUG #4549: ecpg produces code that don't compile
Previous Message Craig Ringer 2008-11-26 13:36:57 Re: PQescapeStringConn in C:\Program Files\PostgreSQL\8.3\lib not found"