\set variant for use in regular sql commands

Поиск
Список
Период
Сортировка
От Jeff Barrett
Тема \set variant for use in regular sql commands
Дата
Msg-id 9le3n2$1e79$1@news.tht.net
обсуждение исходный текст
Список pgsql-sql
I need to use the \set command in regular sql (I am running postgres queries
through php and it does not seem to support the \ commands in general). How
can I set a variable with regular sql?

I want to be able to do the following:

\set testvar '1,2,3,4,5'
\set testvar '6,7,8,':testvar

Which is then used in: select * from table where id in (:testvar);

Thanks,

--Jeff




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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Re: Re: DateDiff, IsNull?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Temp tables being written to disk. Avoidable?