Thread
-
TABLE tab completion
Magnus Hagander <magnus@hagander.net> — 2011-09-24T10:59:06Z
TABLE tab completion in psql only completes to tables, not views. but the TABLE command works fine for both tables and views (and also sequences). Seems we should just complete it to relations and not tables - or can anyone see a particular reason why we shouldn't? Trivial patch attached. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
-
Re: TABLE tab completion
Dean Rasheed <dean.a.rasheed@gmail.com> — 2011-09-25T13:06:47Z
On 24 September 2011 11:59, Magnus Hagander <magnus@hagander.net> wrote: > TABLE tab completion in psql only completes to tables, not views. but > the TABLE command works fine for both tables and views (and also > sequences). > > Seems we should just complete it to relations and not tables - or can > anyone see a particular reason why we shouldn't? > Doesn't that mean that "DROP TABLE <tab>" would offer up views as well as tables, which would be incorrect? Regards, Dean
-
Re: TABLE tab completion
Magnus Hagander <magnus@hagander.net> — 2011-09-26T08:37:50Z
On Sun, Sep 25, 2011 at 15:06, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > On 24 September 2011 11:59, Magnus Hagander <magnus@hagander.net> wrote: >> TABLE tab completion in psql only completes to tables, not views. but >> the TABLE command works fine for both tables and views (and also >> sequences). >> >> Seems we should just complete it to relations and not tables - or can >> anyone see a particular reason why we shouldn't? >> > > Doesn't that mean that "DROP TABLE <tab>" would offer up views as well > as tables, which would be incorrect? Meh - you are correct, of course. I guess that's why we have code review :-) So - not a oneliner, but how about something like this? (Happy to have someone point out a neater way of doing it, not entirely fluent in how we do the tab completion..) -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
-
Re: TABLE tab completion
David Fetter <david@fetter.org> — 2011-09-26T12:29:46Z
On Mon, Sep 26, 2011 at 10:37:50AM +0200, Magnus Hagander wrote: > On Sun, Sep 25, 2011 at 15:06, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: > > On 24 September 2011 11:59, Magnus Hagander <magnus@hagander.net> wrote: > >> TABLE tab completion in psql only completes to tables, not views. but > >> the TABLE command works fine for both tables and views (and also > >> sequences). > >> > >> Seems we should just complete it to relations and not tables - or can > >> anyone see a particular reason why we shouldn't? > >> > > > > Doesn't that mean that "DROP TABLE <tab>" would offer up views as well > > as tables, which would be incorrect? > > Meh - you are correct, of course. I guess that's why we have code review :-) > > So - not a oneliner, but how about something like this? > > (Happy to have someone point out a neater way of doing it, not > entirely fluent in how we do the tab completion..) That's pretty much it. Should it also (eventually) do SRFs? Cheers, David. -- David Fetter <david@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.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
-
Re: TABLE tab completion
Magnus Hagander <magnus@hagander.net> — 2011-10-24T11:25:05Z
On Mon, Sep 26, 2011 at 10:37, Magnus Hagander <magnus@hagander.net> wrote: > On Sun, Sep 25, 2011 at 15:06, Dean Rasheed <dean.a.rasheed@gmail.com> wrote: >> On 24 September 2011 11:59, Magnus Hagander <magnus@hagander.net> wrote: >>> TABLE tab completion in psql only completes to tables, not views. but >>> the TABLE command works fine for both tables and views (and also >>> sequences). >>> >>> Seems we should just complete it to relations and not tables - or can >>> anyone see a particular reason why we shouldn't? >>> >> >> Doesn't that mean that "DROP TABLE <tab>" would offer up views as well >> as tables, which would be incorrect? > > Meh - you are correct, of course. I guess that's why we have code review :-) > > So - not a oneliner, but how about something like this? > > (Happy to have someone point out a neater way of doing it, not > entirely fluent in how we do the tab completion..) Rebased on top of the changes Tom made to the infrastructure, and applied. -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/