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

Re: Tab completion for view triggers in psql

From: David Fetter <david(at)fetter(dot)org>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: Josh Kupershmidt <schmiddy(at)gmail(dot)com>,PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tab completion for view triggers in psql
Date: 2010-11-30 09:18:29
Message-ID: 20101130091829.GD4549@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Nov 30, 2010 at 05:48:04PM +0900, Itagaki Takahiro wrote:
> On Wed, Nov 24, 2010 at 12:21, David Fetter <david(at)fetter(dot)org> wrote:
> > Please find attached a patch changing both this and "updateable" to
> > "updatable," also per the very handy git grep I just learned about :)
> 
> I think the patch has two issues to be fixed.
> 
> It expands all tables (and views) in tab-completion after INSERT,
> UPDATE, and DELETE FROM.  Is it an intended change?  IMHO, I don't
> want to expand any schema because my console is filled with system
> tables and duplicated tables with or without schema names :-( .
> 
> (original)
> =# INSERT INTO [tab]
> information_schema.  pg_temp_1.           pg_toast_temp_1.     tbl
> pg_catalog.          pg_toast.            public.
> 
> (patched)
> =# INSERT INTO [tab]
> Display all 113 possibilities? (y or n)

Yes.  I believe that the question of having INSERT INTO [tab] check
for permissions is a separate issue from this patch.  This patch does
bring the question of whether it *should* check such permission into
more focus, though.  Whether it should is probably a matter for a
separate thread, though.  I could create arguments in both directions.

> Also, event names are not completed after INSTEAD OF:
> 
> =# CREATE TRIGGER trg BEFORE [tab]
> DELETE    INSERT    TRUNCATE  UPDATE
> =# CREATE TRIGGER trg INSTEAD OF [tab]
> (no candidates)

This one's fixed in the attached patch, although subsequent events, as
in 

=# CREATE TRIGGER trg BEFORE INSERT OR [tab]

are not.

Thanks for your review :)

Cheers,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

pgsql-hackers by date

Next:From: Csaba NagyDate: 2010-11-30 09:25:01
Subject: Re: DELETE with LIMIT (or my first hack)
Previous:From: Itagaki TakahiroDate: 2010-11-30 08:48:04
Subject: Re: Tab completion for view triggers in psql

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