psql Windows and variables

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема psql Windows and variables
Дата
Msg-id 20090523191434.0b07ddad@dawn.webthatworks.it
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: Asssociative Arrays: Best practices / snippets?
Следующее
От: Havasvölgyi Ottó
Дата:
Сообщение: Re: 8.3: timestamp subtraction