Re: psql treat backslash which is not the first character in the input line as meta-command

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: psql treat backslash which is not the first character in the input line as meta-command
Дата
Msg-id CAFj8pRCJrM9etq02eGfx=xJrwnBZbW5shtY8jRGGmEAKw=KQ4A@mail.gmail.com
обсуждение исходный текст
Ответ на psql treat backslash which is not the first character in the input line as meta-command  (chenhj <chjischj@163.com>)
Ответы Re: psql treat backslash which is not the first character in the input line as meta-command
Список pgsql-bugs
Hi

It is not bug. Upi can you a backslash commands for entering query

postgres=# select 10 \g ~foo
postgres=# \! cat foo
 ?column?
----------
       10
(1 row)

postgres=# select 10 as xx \gset
postgres=# \echo :xx
10

regards

Pavel Stehule

2014-10-29 10:09 GMT+01:00 chenhj <chjischj@163.com>:

> Hi,all
>
> psql treat backslash which is not the first character in the input line
> as meta-command,and failed to execute the next query.
> It seems to be a bug.
>
> Sample1:
> postgres=# select \1 set c2=c1%3 ;
> Invalid command \1. Try \? for help.
> postgres-# select 1;
> ERROR:  syntax error at or near "select"
> LINE 2: select 1;
>         ^
>
>
> Sample2:
> postgres=# a \l
>                               List of databases
>    Name    | Owner  | Encoding  |  Collate   |   Ctype    | Access
> privileges
>
> -----------+--------+-----------+------------+------------+-------------------
>  postgres  | chenhj | SQL_ASCII | C          | C          |
>  template0 | chenhj | SQL_ASCII | C          | C          | =c/chenhj
>    +
>            |        |           |            |            |
> chenhj=CTc/chenhj
>  template1 | chenhj | SQL_ASCII | C          | C          | =c/chenhj
>    +
>            |        |           |            |            |
> chenhj=CTc/chenhj
> (6 rows)
>
> postgres-# select 1;
> ERROR:  syntax error at or near "a"
> LINE 1: a
>         ^
>
> Regards,
> Chen Huajun
>

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

Предыдущее
От: chenhj
Дата:
Сообщение: psql treat backslash which is not the first character in the input line as meta-command
Следующее
От: Federico Campoli
Дата:
Сообщение: Re: BUG #11811: Server segfault with many subpartitions when using nestloop