Re: [HACKERS] Tab completion for view triggers in psql

2010-12-16 Thread David Fetter
On Thu, Dec 16, 2010 at 07:40:31AM -0500, Greg Smith wrote: > David Fetter wrote: > >That we're in the position of having prevN_wd for N = 1..5 as the > >current code exists is a sign that we need to refactor the whole > >thing, as you've suggested before. > > > >I'll work up a design and prototype

Re: [HACKERS] Tab completion for view triggers in psql

2010-12-16 Thread Greg Smith
David Fetter wrote: That we're in the position of having prevN_wd for N = 1..5 as the current code exists is a sign that we need to refactor the whole thing, as you've suggested before. I'll work up a design and prototype for this by this weekend. Great. I don't think issues around tab com

Re: [HACKERS] Tab completion for view triggers in psql

2010-12-14 Thread David Fetter
On Mon, Dec 13, 2010 at 10:48:54PM -0500, Robert Haas wrote: > On Tue, Nov 30, 2010 at 9:15 AM, David Fetter wrote: > >> Patch attached. If you think my changes are ok, > >> please change the patch status to "Ready for Committer". > > > > Done :) > > I have committed part of this patch. Great!

Re: [HACKERS] Tab completion for view triggers in psql

2010-12-13 Thread Robert Haas
On Tue, Nov 30, 2010 at 9:15 AM, David Fetter wrote: >> Patch attached. If you think my changes are ok, >> please change the patch status to "Ready for Committer". > > Done :) I have committed part of this patch. The rest is attached. I don't know that there's any problem with it, but I ran out

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-30 Thread David Fetter
On Tue, Nov 30, 2010 at 08:13:37PM +0900, Itagaki Takahiro wrote: > On Tue, Nov 30, 2010 at 18:18, David Fetter wrote: > >> It expands all tables (and views) in tab-completion after INSERT, > >> UPDATE, and DELETE FROM.  Is it an intended change? > > I found it was a simple bug; we need ( ) aroun

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-30 Thread Itagaki Takahiro
On Tue, Nov 30, 2010 at 18:18, David Fetter wrote: >> It expands all tables (and views) in tab-completion after INSERT, >> UPDATE, and DELETE FROM.  Is it an intended change? I found it was a simple bug; we need ( ) around selcondition. In addition, I modified your patch a bit: * I added a sepa

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-30 Thread David Fetter
On Tue, Nov 30, 2010 at 05:48:04PM +0900, Itagaki Takahiro wrote: > On Wed, Nov 24, 2010 at 12:21, David Fetter 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 is

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-30 Thread Itagaki Takahiro
On Wed, Nov 24, 2010 at 12:21, David Fetter 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

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-26 Thread David Fetter
On Wed, Nov 24, 2010 at 11:01:28PM -0500, Josh Kupershmidt wrote: > On Tue, Nov 23, 2010 at 10:21 PM, David Fetter 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 looked a little more at

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-24 Thread Josh Kupershmidt
On Tue, Nov 23, 2010 at 10:21 PM, David Fetter 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 looked a little more at this patch today. I didn't find any serious problems, though it would have

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-23 Thread David Fetter
On Tue, Nov 23, 2010 at 09:37:57PM -0500, Josh Kupershmidt wrote: > On Fri, Oct 29, 2010 at 10:33 AM, David Fetter wrote: > > That seems like a matter for a separate patch.  Looking this over, I > > found I'd created a query that can never get used, so please find > > enclosed the next version of

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-23 Thread Josh Kupershmidt
On Fri, Oct 29, 2010 at 10:33 AM, David Fetter wrote: > That seems like a matter for a separate patch.  Looking this over, I > found I'd created a query that can never get used, so please find > enclosed the next version of the patch :) I like "deletables" better than "deleteables" for Query_for_

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-22 Thread Alvaro Herrera
Excerpts from David Fetter's message of dom nov 21 21:17:12 -0300 2010: > Given its small and isolated nature, I was hoping we could get this in > sooner rather than later. As I understand it, CFs are there to review > patches that take significant effort for even a committer to > understand, so

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread David Fetter
On Sun, Nov 21, 2010 at 08:27:34PM -0500, Robert Haas wrote: > On Sun, Nov 21, 2010 at 7:17 PM, David Fetter wrote: > > On Sun, Nov 21, 2010 at 07:09:08PM -0500, Robert Haas wrote: > >> On Sun, Nov 21, 2010 at 4:05 PM, David Fetter wrote: > >> >> > Could someone please commit this? :) > >> >> > >

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread Robert Haas
On Sun, Nov 21, 2010 at 7:17 PM, David Fetter wrote: > On Sun, Nov 21, 2010 at 07:09:08PM -0500, Robert Haas wrote: >> On Sun, Nov 21, 2010 at 4:05 PM, David Fetter wrote: >> >> > Could someone please commit this? :) >> >> >> >> Eh... was there some reason you didn't add it to the CommitFest app?

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread David Fetter
On Sun, Nov 21, 2010 at 07:09:08PM -0500, Robert Haas wrote: > On Sun, Nov 21, 2010 at 4:05 PM, David Fetter wrote: > >> > Could someone please commit this? :) > >> > >> Eh... was there some reason you didn't add it to the CommitFest app? > > > > I forgot. > > A fair excuse. :-) > > >> Because

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread Robert Haas
On Sun, Nov 21, 2010 at 4:05 PM, David Fetter wrote: >> > Could someone please commit this? :) >> >> Eh... was there some reason you didn't add it to the CommitFest app? > > I forgot. A fair excuse. :-) >> Because that's what I work from. > > It's pretty trivial, but I don't feel comfortable ad

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread David Fetter
On Sun, Nov 21, 2010 at 03:36:58PM -0500, Robert Haas wrote: > On Sun, Nov 21, 2010 at 1:07 PM, David Fetter wrote: > > On Fri, Oct 29, 2010 at 08:33:00AM -0700, David Fetter wrote: > >> On Tue, Oct 26, 2010 at 11:55:07AM +0900, Itagaki Takahiro wrote: > >> > On Tue, Oct 26, 2010 at 11:34 AM, Davi

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread Robert Haas
On Sun, Nov 21, 2010 at 1:07 PM, David Fetter wrote: > On Fri, Oct 29, 2010 at 08:33:00AM -0700, David Fetter wrote: >> On Tue, Oct 26, 2010 at 11:55:07AM +0900, Itagaki Takahiro wrote: >> > On Tue, Oct 26, 2010 at 11:34 AM, David Fetter wrote: >> > >> Do we need to 'add' it? >> > > Possibly.  My

Re: [HACKERS] Tab completion for view triggers in psql

2010-11-21 Thread David Fetter
On Fri, Oct 29, 2010 at 08:33:00AM -0700, David Fetter wrote: > On Tue, Oct 26, 2010 at 11:55:07AM +0900, Itagaki Takahiro wrote: > > On Tue, Oct 26, 2010 at 11:34 AM, David Fetter wrote: > > >> Do we need to 'add' it? > > > Possibly.  My understanding is that it couldn't really replace it. > > >

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-29 Thread David Fetter
On Tue, Oct 26, 2010 at 11:55:07AM +0900, Itagaki Takahiro wrote: > On Tue, Oct 26, 2010 at 11:34 AM, David Fetter wrote: > >> Do we need to 'add' it? > > Possibly.  My understanding is that it couldn't really replace it. > > Ah, I see. I was wrong. We can have modification privileges for > vie

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-26 Thread David Fetter
On Tue, Oct 26, 2010 at 12:35:13PM +0100, Dean Rasheed wrote: > On 25 October 2010 21:01, David Fetter wrote: > > Folks, > > > > Please find attached patch for $subject :) > > > > Thanks for looking at this. I forgot about tab completion. > > I think that the change to ALTER TRIGGER is not neces

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-26 Thread Dean Rasheed
On 25 October 2010 21:01, David Fetter wrote: > Folks, > > Please find attached patch for $subject :) > Thanks for looking at this. I forgot about tab completion. I think that the change to ALTER TRIGGER is not necessary. AFAICT it works OK unmodified. In fact, the modified code here: *** 971,9

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 11:34 AM, David Fetter wrote: >> Do we need to 'add' it? > Possibly.  My understanding is that it couldn't really replace it. Ah, I see. I was wrong. We can have modification privileges for views even if they have no INSTEAD OF triggers. So, I think your original patch is

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread David Fetter
On Tue, Oct 26, 2010 at 11:10:53AM +0900, Itagaki Takahiro wrote: > On Tue, Oct 26, 2010 at 10:53 AM, David Fetter wrote: > >> How about has_table_privilege() to filter candidate relations > > > > That's orthogonal to tgtype (snip) Shall I send a new patch with > > that added? > > Do we need to '

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 10:53 AM, David Fetter wrote: >> How about has_table_privilege() to filter candidate relations > > That's orthogonal to tgtype (snip) > Shall I send a new patch with that added? Do we need to 'add' it? I intended to replace the JOIN with pg_trigger to has_table_privilege()

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread David Fetter
On Tue, Oct 26, 2010 at 10:30:49AM +0900, Itagaki Takahiro wrote: > On Tue, Oct 26, 2010 at 5:01 AM, David Fetter wrote: > > Please find attached patch for $subject :) > > Thank you for maintaining psql tab completion, but I'm not sure > whether tgtype is the best column for the purpose. How abo

Re: [HACKERS] Tab completion for view triggers in psql

2010-10-25 Thread Itagaki Takahiro
On Tue, Oct 26, 2010 at 5:01 AM, David Fetter wrote: > Please find attached patch for $subject :) Thank you for maintaining psql tab completion, but I'm not sure whether tgtype is the best column for the purpose. How about has_table_privilege() to filter candidate relations in Query_for_list_of_i