Re: BUG #14493: psql command : Unable to use set with \copy

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: maxandreogeret(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14493: psql command : Unable to use set with \copy
Date: 2017-01-12 15:26:41
Message-ID: 17199.1484234801@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

maxandreogeret(at)gmail(dot)com writes:
> When launching a .sql file from batch script with psql command you can't
> pass a variable with set.

I think the actual issue here has nothing to do with batch files;
rather the problem is that \copy doesn't expand potential variable
references in its arguments. I'm not sure about the compatibility
implications of changing that. In the meantime, perhaps you could
use COPY instead of \copy.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ragnar Ouchterlony 2017-01-12 15:42:25 Re: Problem with declarative partitioning and COPY FROM
Previous Message maxandreogeret 2017-01-12 09:47:50 BUG #14493: psql command : Unable to use set with \copy