Passing Parameters To Command Scripts

Поиск
Список
Период
Сортировка
От Duncan Garland
Тема Passing Parameters To Command Scripts
Дата
Msg-id MBEPKEEDMKGCDODFKLPPGECHDEAA.duncan.garland@ntlworld.com
обсуждение исходный текст
Ответы Re: Passing Parameters To Command Scripts  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-novice
I'm in the process of converting some Oracle SQL scripts to Postgres. Many
of the scripts accept arguments along the following
lines:

@tmp.sql fred

I can't find the Postgres equivalent.

This works from outside Postgres:

psql -f tmp.sql -v arg1=fred

This works from within psql

\set arg1 fred
\i tmp.sql
\unset arg1

But the following all fail

\i tmp.sql fred
\i tmp.sql arg1=fred
\i tmp.sql -v arg1=fred

Can anyone help? What is the correct syntax?


В списке pgsql-novice по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: hardware - generic
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Passing Parameters To Command Scripts