On Wed, Dec 31, 2014, at 12:01 PM, dvlsg wrote: > Yeah, I think that would be problematic. All other sql query > applications I've used in the past with autocomplete seem to parse the > entire query and find table references for autocompletion based on the > whole query, whereas psql seems to typically base autocomplete off of > the current cursor location and strings behind it without any > lookaheads (as far as I can tell -- I only took a brief look, and it's > been a long time since I've had to write C code). > > I suppose what I would really be looking for is something like the > vastly simplified query below, where pressing Ctrl+Space after each > "a." would provide a list of columns only for the table alias. > > SELECT a.Column1, a.Column2, a.Column3 FROM > public.a_table_for_querying a > > It looks like that would take a fairly significant bit of > work/overhaul to make the autocomplete parser look at the entire query > to find a list of used tables, and then find the list of available > columns based on that, if I'm reading the code correctly. > > I agree with that last sentiment, though -- I don't think a list of > every column from every table would be very helpful.
Just ran across pgcli which does you what you want from the command line: https://github.com/amjith/pgcli > > > > Dave Lesage *Club **Speed, Inc.* *Software Engineer* 4740 Green River > Road, Suite #308 Corona, CA 92880 > > Email: [hidden email] 24 Hour Support: (877) 751-3200 International > Support: (951) 817-7073 > > This e-mail is covered by the Electronic Communications Privacy Act, > 18 USC ยงยง 2510-2521 and is legally privileged. This communication and > any accompanying document(s) are confidential and privileged. They are > intended for the sole use of the addressee. If you receive this > transmission in error, you are advised that any disclosure, copying, > distribution, or the taking of any action in reliance upon the > communication is strictly prohibited. If you have received this > communication in error, please contact Club Speed, Inc. at (877) > 751-3200. > > > View this message in context: Re: PSQL/pgAdmin - Column Completion[1] > Sent from the PostgreSQL - general mailing list archive[2] at Nabble.com. Links: 1. http://postgresql.nabble.com/PSQL-pgAdmin-Column-Completion-tp5832573p5832578.html 2. http://postgresql.nabble.com/PostgreSQL-general-f1843780.html
-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general