Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRhH5-0001A5-BG for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 15:26:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cRhH4-00027O-Cb for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Jan 2017 15:26:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRhH3-00024w-Ei for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 15:26:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRhH0-0005qI-9d for pgsql-bugs@postgresql.org; Thu, 12 Jan 2017 15:26:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0CFQfP3017200; Thu, 12 Jan 2017 10:26:41 -0500 From: Tom Lane To: maxandreogeret@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14493: psql command : Unable to use set with \copy In-reply-to: <20170112094750.24292.7814@wrigleys.postgresql.org> References: <20170112094750.24292.7814@wrigleys.postgresql.org> Comments: In-reply-to maxandreogeret@gmail.com message dated "Thu, 12 Jan 2017 09:47:50 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17198.1484234801.1@sss.pgh.pa.us> Date: Thu, 12 Jan 2017 10:26:41 -0500 Message-ID: <17199.1484234801@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org maxandreogeret@gmail.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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs