Skip site navigation (1) Skip section navigation (2)

Re: psql: tab-completion fails SET var=

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql: tab-completion fails SET var=
Date: 2012-08-28 16:55:08
Message-ID: 20120828165508.GE16116@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, Mar 30, 2012 at 08:15:22PM +0200, Erik Rijkers wrote:
> (in hopes that the current changes to tab-completion will help to get this fixed)
> 
> tab-completion goes wrong on SET setting=...
> 
> example:
> 
> If you want to input "set search_path=myschema;" without spaces around '=',
> and you try tab-completion halfway the schemaname:
> 
> set search_path=mysch
>                       ^tab
> 
> then the initial part of the schema name ('mysch') gets removed and replaced with 'TO'.
> 
> So that you now have:
> 
> set search_path=TO <cursor>
> 
> You lose the part of the schema name that was already input.
> 
> With spaces that doesn't happen, but after all tabcompletion is about avoiding keystrokes and errors.
> 
> Tab-completion is great and this search_path-annoyance happens to me all the time; my fingers
> can't seem to learn this exception.
> 
> (pgsql 9.2devel, problem also in latest 9.1.3)

I have fixed this with the attached patch.  It does not do any further
competion of DEFAULT or other known settings if the equal sign has no
space before it.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachment: psql.diff
Description: text/x-diff (585 bytes)

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2012-08-28 16:59:38
Subject: Re: Timing overhead and Linux clock sources
Previous:From: Greg StarkDate: 2012-08-28 16:47:40
Subject: Re: MySQL search query is not executing in Postgres DB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group