Tab completion of double quoted identifiers broken

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Tab completion of double quoted identifiers broken
Date: 2012-03-31 08:28:38
Message-ID: CAEZATCXutha5_fD5Pz+Ken9yiaCwt6o+uCUAupEwsx-Mb_1oyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I just spotted that tab completion of double quoted identifiers seems
to be broken in 9.2devel. For example things like this which worked in
9.1 no longer work:

UPDATE "foo bar" <tab>

It looks like the problem is in get_previous_words() here:

if (buf[start] == '"')
inquotes = !inquotes;
else if (!inquotes)
{
... test for start of word ...

which fails to account for the fact that the double quote itself might
be the start of the word. I think the solution is just to remove the
"else":

if (buf[start] == '"')
inquotes = !inquotes;
if (!inquotes)
{
... test for start of word ...

to allow it to find a word-breaking character immediately before the
double quote.

Regards,
Dean

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-03-31 08:53:51 Re: measuring lwlock-related latency spikes
Previous Message Hitoshi Harada 2012-03-31 05:59:44 Re: Odd out of memory problem.