psql Windows and variables - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject psql Windows and variables
Date
Msg-id 20090523191434.0b07ddad@dawn.webthatworks.it
Whole thread Raw
List pgsql-general
I need to loop from DOS [sic] on a set of files to get them imported
into a table.

I noticed that psql is wrapped up in a import.bat

I wrote another bat that substantially do

rem import.bat
FOR %%f in (pattern) do "longpathtopsql.bat" --variable csvfile=%%f
-f some.sql


-- some.sql
\copy import.transaction from :csvfile


but I get
some.sql:3: :csvfile: No such file or directory

I tried -v --set etc...

Same result.

How can I pass variables to a sql script?

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


pgsql-general by date:

Previous
From: Steve Atkins
Date:
Subject: Re: Asssociative Arrays: Best practices / snippets?
Next
From: Havasvölgyi Ottó
Date:
Subject: Re: 8.3: timestamp subtraction