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>)
Список pgsql-general
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
Дата:
Сообщение: psql -c command parse "select $$hello$$" failed
Следующее
От: Erik Wienhold
Дата:
Сообщение: Re: psql -c command parse "select $$hello$$" failed