From: chenhj <chjischj@163.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: psql treat backslash which is not the first character in the input line as meta-command
Date: Wed, 29 Oct 2014 17:38:33 +0800 (CST)
Message-ID: <1a569092.da75.1495b455db6.Coremail.chjischj@163.com> (raw)
In-Reply-To: <CAFj8pRCJrM9etq02eGfx=xJrwnBZbW5shtY8jRGGmEAKw=KQ4A@mail.gmail.com>
References: <2c11ec45.d072.1495b2a551b.Coremail.chjischj@163.com>
<CAFj8pRCJrM9etq02eGfx=xJrwnBZbW5shtY8jRGGmEAKw=KQ4A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Hi
I understand,Thanks!
regards,
Chen Huajun
At 2014-10-29 17:25:23, "Pavel Stehule" <pavel.stehule@gmail.com> wrote:
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: chjischj@163.com, pavel.stehule@gmail.com
Subject: Re: psql treat backslash which is not the first character in the input line as meta-command
In-Reply-To: <1a569092.da75.1495b455db6.Coremail.chjischj@163.com>
References: <2c11ec45.d072.1495b2a551b.Coremail.chjischj@163.com> <CAFj8pRCJrM9etq02eGfx=xJrwnBZbW5shtY8jRGGmEAKw=KQ4A@mail.gmail.com> <1a569092.da75.1495b455db6.Coremail.chjischj@163.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox