Re: PSQL/pgAdmin - Column Completion

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: dvlsg <dave(at)clubspeed(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PSQL/pgAdmin - Column Completion
Date: 2015-01-09 19:31:15
Message-ID: 1420831875.2140035.211956377.6A76C1B0@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

Attachment Content-Type Size
image/png 10.8 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dvlsg 2015-01-09 19:44:55 Re: PSQL/pgAdmin - Column Completion
Previous Message Alvaro Herrera 2015-01-09 17:04:00 Re: GCC error while trying to install 9.4 via brew on MAC OS