BUG #14554: Tab on new line after VALUES clause in INSERT statement echoes opening bracket

Started by Tomisław Kityńskiabout 9 years ago2 messagesbugs
Jump to latest
#1Tomisław Kityński
t.kitynski@gmail.com

The following bug has been logged on the website:

Bug reference: 14554
Logged by: Tomisław Kityński
Email address: t.kitynski@gmail.com
PostgreSQL version: 9.6.2
Operating system: Linux (Debian, Wheezy)
Description:

This happens when connecting with 9.6.2 psql-client to 9.5.6 psql-server
(possibly it concerns also connecting to more recent servers). This runs on
Cygwin (Windows), after ssh to Debian Wheezy server, su postgres and then
psql testbase. First I copy-pasted some INSERT statement from my editor to
the console, but it didn't execute but waited for more input. I found out,
that I need to close round bracket. I checked my source, but it was correct.
It was like:

INSERT INTO foo.bar(bar_id, a, b)
VALUES
(0, 'a', 'Aaa'),
(1, 'b', 'Bbb')
;

but after pasting it into the console I got this:

testbase=# INSERT INTO foo.bar (bar_id, a, b)
testbase-# VALUES
testbase-# ( (0, 'a', 'Aaa'),
testbase(# (1, 'b', 'Bbb')
testbase(# ;

Please note extra opening bracket in 3-rd line at the start of line.

This can be reproduced even by typing it manually, i.e. after INSERT line
one need to press enter, then enter VALUES clause, then enter, THEN TAB and
it is where opening bracket pops up for no apparent reason. Until 9.5.6
version of psql-client I was able to copy-paste scripts with indentation
tabs, thou they give a lot of beeps from terminal as the tried to (my guess)
auto complete current query but it wasn't able to find anything useful,
however the DML statement could be pasted and executed. Now it is impossible
(one need to change indentation to spaces to actually successfully paste a
tab indented query).

Greetings,
TK

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Tomisław Kityński (#1)
Re: BUG #14554: Tab on new line after VALUES clause in INSERT statement echoes opening bracket

Hello,

At Mon, 20 Feb 2017 00:21:05 +0000, t.kitynski@gmail.com wrote in <20170220002105.1268.33801@wrigleys.postgresql.org>

INSERT INTO foo.bar(bar_id, a, b)
VALUES
(0, 'a', 'Aaa'),
(1, 'b', 'Bbb')
;

but after pasting it into the console I got this:

testbase=# INSERT INTO foo.bar (bar_id, a, b)
testbase-# VALUES
testbase-# ( (0, 'a', 'Aaa'),

You need to turn off the tab-completion fetature. The following
URL will tell you the details.

https://www.postgresql.org/docs/9.6/static/app-psql.html#AEN100672

reagrds,

--
Kyotaro Horiguchi
NTT Open Source Software Center

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs