Re: psql -c command parse "select $$hello$$" failed

Поиск
Список
Период
Сортировка
Искать
От
Julien Rouhaud
Тема
Re: psql -c command parse "select $$hello$$" failed
Дата
Msg-id
20230704123616.f5g67rkdpdlalypf@jrouhaud
Ответ на
Список
Дерево обсуждения
psql -c command parse "select $$hello$$" failed jian he <jian.universality@gmail.com>
Re: psql -c command parse "select $$hello$$" failed Erik Wienhold <ewie@ewie.name>
Re: psql -c command parse "select $$hello$$" failed Julien Rouhaud <rjuju123@gmail.com>
Hi,

On Tue, Jul 04, 2023 at 08:21:10PM +0800, jian he wrote:
> Hi.
> not sure this is the expected result.
>
> /home/jian/postgres/pg16_test/bin/psql -d test_dev -p 5455 -c "select $$hello$$"
> 2023-07-04 20:15:51.066 CST [1562050] ERROR:  trailing junk after
> numeric literal at or near "884070h" at character 8
> 2023-07-04 20:15:51.066 CST [1562050] STATEMENT:  select 884070hello884070
> ERROR:  trailing junk after numeric literal at or near "884070h"
> LINE 1: select 884070hello884070
>                ^

That's expected, $ is used for variable in the shell and is the pid of the
current process.  You have to escape any $ in a double-quoted string, or use a
single quoted strings.


В списке pgsql-general по дате отправления
От: jian he
Дата:
От: Erik Wienhold
Дата:
FAQ