Re: BUG #13655: Incorrect Syntax Error

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "stormbyte(at)gmail(dot)com" <stormbyte(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13655: Incorrect Syntax Error
Date: 2015-10-01 02:02:51
Message-ID: CAJrrPGd7rBcHtS+ZG3TkRdANn4cLqXDmLbXb1BRxGNcFgQXCmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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:
>>
>> On Thu, Oct 1, 2015 at 5:25 AM, <stormbyte(at)gmail(dot)com> wrote:
>> > The following bug has been logged on the website:
>> >
>> > Bug reference: 13655
>> > Logged by: David
>> > Email address: stormbyte(at)gmail(dot)com
>> > PostgreSQL version: 9.4.4
>> > Operating system: Gentoo Linux
>> > Description:
>> >
>> > When using field names with "", and custom data type, with its name also
>> > with "", a syntax error is triggered in CREATE TABLE when tab character
>> > is
>> > used instead of spaces.
>> >
>> > To reproduce, create a sql file with: (Insert tab and NOT space when
>> > <TAB>
>> > is specified)
>> > CREATE TYPE "GPSPoint" AS ("lat" DECIMAL(9,6), "lon" DECIMAL(9,6));
>> >
>> > CREATE TABLE "TestTable" ("testGPS"<TAB>"GPSPoint" NOT NULL);
>> >
>> > Save it, and copy/paste to psql, you will see an syntax error near NOT.
>> >
>> > That is workarounded by inserting <SPACE> before or instead of <TAB>,
>> > but
>> > should not trigger any syntax error, as the same syntax works for
>> > bundled
>> > types, so the following does not fail:
>> > CREATE TABLE "TestTable" ("test"<TAB>SMALLINT NOT NULL);
>> >
>> > This is a low priority bug, but a bit annoying
>>
>> 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.

> Not having tested this myself the OP is lacking in their description of how
> exactly they are passing the SQL to psql. "Copy/paste to psql" is decidedly
> unclear.

Tab-completion comes into picture only when user tries to write the query or
paste the query from a notepad with tab characters in it.

Regards,
Hari Babu
Fujitsu Australia

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-10-01 04:44:48 Re: BUG #13655: Incorrect Syntax Error
Previous Message David G. Johnston 2015-10-01 01:56:06 Re: BUG #13655: Incorrect Syntax Error