Re: BUG #13655: Incorrect Syntax Error

From: David <stormbyte(at)gmail(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13655: Incorrect Syntax Error
Date: 2015-10-01 08:05:41
Message-ID: 20151001100541.29dfdb38@Zero.StormByte.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

El Thu, 01 Oct 2015 00:44:48 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escribió:
> Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com> writes:
> > On Thu, Oct 1, 2015 at 11:56 AM, David G. Johnston
> > <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >> On Wednesday, September 30, 2015, Haribabu Kommi
> >> <kommi(dot)haribabu(at)gmail(dot)com> wrote:
> >>> As I feel this is not a bug. psql has the tab complete feature
> >>> with the help of readline library.
> >>> Means it tries fill the command if the user provides the tab key
> >>> as input.
>
> >> Tab-completion should not interfere with script code provided
> >> non-interactively on standard input, or in a script file loaded
> >> using -f or \i
>
> > Tab-completion doesn't change <TAB> characters if the file passed
> > using -f or \i.
>
> Yeah. I could not reproduce the reported error when feeding the file
> to psql using "-f file", "<file", or "\i file". It is possible to get
> it by pasting the given text into a terminal window, so that readline
> can't tell that you didn't manually type the TAB.
>
> Worth noting here is you can turn off readline with the -n option
> to psql. I've done that sometimes when there was a reason not to want
> TAB to act as command-completion.
>
> regards, tom lane

(resent to mailing list instead of simple reply)
The real question here is: Since tab character triggers
autocompletion (or hints), when copy/pasted it has no effect, but:
Isn't it inconsistent that a thing like: "someField"SMALLINT works
whether a thing like: "someField""SomeCustomType" is not working?

Both forms have the exact same format: a field perfectly delimitated,
and after a type for that field with no space nor separation, both seems
legal to me, as parser knows exactly what is what (unlike the case
below) (even if you write directly without spaces at all).

I understand however, that using it without quoted (without
delimitation), can cause a syntax error in case like:
someFieldSMALLINT, but that's not the case.

Anyway, everything has been said in this regard, just wanted to say
this, as to my eyes, it's kind of inconsistent allow one case, but not
allowing the other.

David.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message swingi 2015-10-01 10:17:33 BUG #13656: table inheritance, pg_dump emits same constraint for all inheritors causing errors
Previous Message Tom Lane 2015-10-01 04:44:48 Re: BUG #13655: Incorrect Syntax Error