Re: PATCH: psql tab completion for SELECT - Mailing list pgsql-hackers

From Joao De Almeida Pereira
Subject Re: PATCH: psql tab completion for SELECT
Date
Msg-id CAE+jjan-G56UtECBfk70niM=GxDG3dB=Sw-6KJB4Y=FmU=JLEg@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: psql tab completion for SELECT  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: PATCH: psql tab completion for SELECT  (Edmund Horner <ejrh00@gmail.com>)
List pgsql-hackers
Hello,

postgres=# select partkey, partc[TAB]
[no completions]

From the thread, I believe that this feature will be implemented in a after patch. 

And I'd love this case, where go back to edit the SELECT list, after
already typing the FROM part, to be smarter:

postgres=# select p[TAB] FROM lp;
Display all 370 possibilities? (y or n)
 
I believe this would be a very interesting feature indeed. 
 

After playing alittle bit around with the patch I noticed that a comma was missing in line 1214
+ 1202                 /* min_server_version */
+ 1203                 90000,
+ 1204                 /* catname */
+ 1205                 "pg_catalog.pg_proc p",
+ 1206                 /* selcondition */
+ 1207                 "p.prorettype NOT IN ('trigger'::regtype, 'internal'::regtype) "
+ 1208                 "AND 'internal'::regtype != ALL (p.proargtypes) "
+ 1209                 "AND p.oid NOT IN (SELECT unnest(array[typinput,typoutput,typreceive,typsend,typmodin,typmodout,typanalyze]) FROM pg_type) "
+ 1210                 "AND p.oid NOT IN (SELECT unnest(array[aggtransfn,aggfinalfn]) FROM pg_aggregate) "
+ 1211                 "AND p.oid NOT IN (SELECT unnest(array[oprcode,oprrest,oprjoin]) FROM pg_operator) "
+ 1212                 "AND p.oid NOT IN (SELECT unnest(array[lanplcallfoid,laninline,lanvalidator]) FROM pg_language) "
+ 1213                 "AND p.oid NOT IN (SELECT castfunc FROM pg_cast) "
+ 1214                 "AND p.oid NOT IN (SELECT amproc FROM pg_amproc) "
+ 1215                 /* viscondition */
+ 1216                 "pg_catalog.pg_function_is_visible(p.oid)",

To catch these typos would be good if we could get some testing around psql. 
(Newbie question: do we have any kind of testing around tools like psql?)

Thanks
Joao
 

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: New GUC to sample log queries
Next
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] Re: [COMMITTERS] pgsql: Remove pgbench "progress" testpending solution of its timing is (fwd)