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: Robert Haas <robertmhaas@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: IF (NOT) EXISTS in psql-completion
Date: Sun, 26 Feb 2017 20:12:23 -0500
Message-ID: <1322.1488157943@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqRy0A9RY=NhbusoZ7FW5icF3vjUSi3Grhz1=+Wp-Wu8gg@mail.gmail.com>
References: <CAFj8pRAHCwdwe+NRTQ9JrtMO2OdUWtp1demmv_jGBU2tRRs-CQ@mail.gmail.com>
	<20170203.171712.150614683.horiguchi.kyotaro@lab.ntt.co.jp>
	<CAFj8pRD85cnxEEgLtOoqL-Bda2XpzvHB3a6Mr+bvf+OKpiq3Eg@mail.gmail.com>
	<20170214.195152.59283261.horiguchi.kyotaro@lab.ntt.co.jp>
	<CAFj8pRAgwABQUVkbLVnEjDp+OgLWwK3w5P9pC985xfTz+Qbqug@mail.gmail.com>
	<CA+TgmoaOrwTjMtAbwb5Vd43APi-hFbA8XRJSyqvKui7qqwim=Q@mail.gmail.com>
	<19657.1488140516@sss.pgh.pa.us>
	<CAB7nPqRy0A9RY=NhbusoZ7FW5icF3vjUSi3Grhz1=+Wp-Wu8gg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Michael Paquier <michael.paquier@gmail.com> writes:
> On Mon, Feb 27, 2017 at 5:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> So I'd be a whole lot happier if it didn't do that.  Can we really not
>> add the desired features in a more localized fashion?

> As "if not exists" is defined after the object type if would not be
> that complicated to add completion for IE/INE after the object type
> with a set of THING_* flags in words_after_create. One missing piece
> would be to add completion for the objects themselves after IE or INE
> have been entered by the user, but I would think that tweaking the
> checks on words_after_create[i] would be doable as well. And that
> would be localized.

BTW ... can anyone explain to me the reason why we offer to complete
CREATE OBJECT with the names of existing objects of that kind?
That seems pretty darn stupid.  I can see offering the names of existing
schemas there, if the object type is one that has schema-qualified names,
but completing with an existing object name is just setting up to fail
isn't it?

If we dropped that behavior, seems like it would become much easier
to plug in IF NOT EXISTS at those spots.

			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 (90+ messages)  latest in thread

Message-ID: <1322.1488157943@sss.pgh.pa.us>
Permalink:  ../1322.1488157943@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1322.1488157943@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, robertmhaas@gmail.com, pavel.stehule@gmail.com, horiguchi.kyotaro@lab.ntt.co.jp
  Subject: Re: IF (NOT) EXISTS in psql-completion
  In-Reply-To: <1322.1488157943@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