Re: psql: Add command to use extended query protocol

Поиск
Список
Период
Сортировка
От Jehan-Guillaume de Rorthais
Тема Re: psql: Add command to use extended query protocol
Дата
Msg-id 20221102134327.2887f82b@karst
обсуждение исходный текст
Ответ на psql: Add command to use extended query protocol  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: psql: Add command to use extended query protocol  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: psql: Add command to use extended query protocol  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-hackers
Hi,

On Fri, 28 Oct 2022 08:52:51 +0200
Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:

> This adds a new psql command \gp that works like \g (or semicolon) but
> uses the extended query protocol.  Parameters can also be passed, like
> 
>      SELECT $1, $2 \gp 'foo' 'bar'

As I wrote in my TCE review, would it be possible to use psql vars to set some
named parameters for the prepared query? This would looks like:

  \set p1 foo
  \set p2 bar
  SELECT :'p1', :'p2' \gp

This seems useful when running psql script passing it some variables using
-v arg. It helps with var position, changing some between exec, repeating them
in the query, etc.

Thoughts?



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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: Make ON_ERROR_STOP stop on shell script failure
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: psql: Add command to use extended query protocol