pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Making tab-complete.c easier to maintain
Date: Tue, 29 Dec 2015 11:21:49 -0500
Message-ID: <1011.1451406109@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqQbBxBWGuVZ1a4ZZDic=D3NJg=gpo18UtND0_aCV0eiRw@mail.gmail.com>
References: <CAB7nPqQ-=c0P7A1cWAo7ONNEPfq4+aNpX86a+oHKS4bcGs2C6Q@mail.gmail.com>
	<CAEepm=1x-inE_3Hsa07Wp5zDg2puGR1TdJsstgm0=ATXpxur=Q@mail.gmail.com>
	<CAB7nPqSggjPA8U1WV7ivW44xzboC8pci_Etmffr+ZEzxSX_ahA@mail.gmail.com>
	<20151217.150633.216859242.horiguchi.kyotaro@lab.ntt.co.jp>
	<CAB7nPqS=UHm2QyJtx+kyyHb4WH09vK3NVUqJVFBotQAQx5hD4g@mail.gmail.com>
	<CAEepm=2vMAESiiind-jbQK-sAibLr1440E8pj_KmWYO8XBtiRA@mail.gmail.com>
	<1851.1450471370@sss.pgh.pa.us>
	<CAB7nPqS0-TjcwUWM4R+-77aCrAz9B6a+S_d973CeJvfLm7r-Tg@mail.gmail.com>
	<21460.1450560248@sss.pgh.pa.us>
	<CAB7nPqQpDTQHn3s20-xLP93Cs3LBpCtedrSO1yN8kRoMhSg7eg@mail.gmail.com>
	<CAB7nPqQbBxBWGuVZ1a4ZZDic=D3NJg=gpo18UtND0_aCV0eiRw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Michael Paquier <michael.paquier@gmail.com> writes:
>> On Sun, Dec 20, 2015 at 6:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> 1. I think it would be a good idea to convert the matching rules for
>>> backslash commands too.  To do that, we'd need to provide a case-sensitive
>>> equivalent to word_match and the matching macros.  I think we'd also have
>>> to extend word_match to allow a trailing wildcard character, maybe "*".

> I am not really sure I follow much the use of the wildcard, do you
> mean to be able to work with the [S] extensions of the backslash
> commands which are not completed now?

But they are completed:

regression=# \dfS str<TAB>
string_agg          string_agg_transfn  strip
string_agg_finalfn  string_to_array     strpos

This is because of the use of strncmp instead of plain strcmp
in most of the backslash matching rules, eg the above case is
covered by

	else if (strncmp(prev_wd, "\\df", strlen("\\df")) == 0)

I was envisioning that we'd want to convert this to something like

	else if (TailMatchesCS1("\\df*"))

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (86+ messages)  latest in thread

Message-ID: <1011.1451406109@sss.pgh.pa.us>
Permalink:  ../1011.1451406109@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1011.1451406109@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com, thomas.munro@enterprisedb.com, horiguchi.kyotaro@lab.ntt.co.jp, alvherre@2ndquadrant.com, jeff.janes@gmail.com
  Subject: Re: Making tab-complete.c easier to maintain
  In-Reply-To: <1011.1451406109@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox