psql Windows and variables

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: psql Windows and variables
Date: 2009-05-23 17:14:34
Message-ID: 20090523191434.0b07ddad@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Havasvölgyi Ottó 2009-05-23 17:44:28 Re: 8.3: timestamp subtraction
Previous Message Steve Atkins 2009-05-23 17:03:12 Re: Asssociative Arrays: Best practices / snippets?