dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.14k stars 557 forks source link

"list index out of range"-error when including file with trailing comments separated by newline #1193

Closed ftilde closed 4 years ago

ftilde commented 4 years ago

Description

To reproduce: Connect to a postgres database, save the following to a file and include it via \i <file>:

--

--

The shell will report list index out of range.

Commands before the trailing comments will not be executed, i.e., the following will produce the same output and no user will be created:

create role foobar123;
--

--

If the comments are not the last thing in the file, all is fine and commands are executed as expected, as in the following example:

select 1;
--

--
select 2;

Your environment

ftilde commented 4 years ago

Thank you for fixing this!