Re: psql questions

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: psql questions
Дата
Msg-id D0E42022-9CC1-11D9-A708-000A95B03262@pgedit.com
обсуждение исходный текст
Ответ на psql questions  ("Walker, Jed S" <Jed_Walker@cable.comcast.com>)
Список pgsql-novice
On Mar 24, 2005, at 6:29 PM, Walker, Jed S wrote:

> How can do those things in psql?  (I found the \set which seems to
> work, no
> error, but I can't figure out how to use the variable in a psql
> session)


You prefix the variable with a colon to get the value. Here are a few
examples:

\set mystring '\'here is a string\''

select :mystring || ' test';
        ?column?
----------------------
  here is a string test
(1 row)


\set myint 37

select :myint + 10;
  ?column?
----------
        47
(1 row)


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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

Предыдущее
От: "Walker, Jed S"
Дата:
Сообщение: psql questions
Следующее
От: luckydavid@optusnet.com.au
Дата:
Сообщение: install pgaccess under windows xp