RE: arguments for query files

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема RE: arguments for query files
Дата
Msg-id 08CD1781F85AD4118E0800A0C9B8580B094AEF@NEZU
обсуждение исходный текст
Ответ на arguments for query files  (david.brown@mviva.net (David Brown))
Список pgsql-sql
I don't think this is possible in the way that you specify.
What works for me is to include psql variable names in the script file, then
set the values before each run.
psql variables are of the form " :<variable name> ".
To assign a value, just do " \set variable=value ".
I like to include lines at the end of my script to unset these values, of
the form " \unset variable ".
HTH.

> -----Original Message-----
> From:    david.brown@mviva.net [SMTP:david.brown@mviva.net]
> Sent:    Tuesday, June 19, 2001 12:06 PM
> To:    pgsql-sql@postgresql.org
> Subject:    arguments for query files
> 
> Does anybody know how I can pass arguments into files which I execute
> from within psql using \i?
> 
> I want to be able to do something like:
> \i file arg1 arg2
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


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

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: Using the extract() function in plpgsql
Следующее
От: Najm Hashmi
Дата:
Сообщение: Correct syntex for implicit curor in for loops