Thread: psql tab completion

psql tab completion

From
Rod Taylor
Date:
Clean up psql:

Add simple ALTER DATABASE, ALTER TRIGGER, CHECK POINT, CREATE
CONVERSION, CREATE DOMAIN, CREATE LANGUAGE, DEALLOCATE, DROP CONVERSION,
DROP DOMAIN, DROP LANGUAGE, EXECUTE, PREPARE

Complete CAST in CREATE CAST and DROP CAST but doesn't suggest what
should follow.

Add many more SET / SHOW variables to the list.  Taken from SHOW ALL
output.

Complete a case sensitive search to allow \dD, \dd, \dS, \ds, \h, \H to
complete properly.  But there are no matches, then try a case
insensitive search to allow case conversion.  Add all missing help
options.

\Q<tab>    -> \q
\dD<tab>   -> \dD
\dd<tab>   -> \dd
\D<tab><tab><tab> -> \d (with listing of \d? commands)
sel<tab>   -> SELECT


> On the other hand, in psql , tab-completion doesn't seem to
> work for certain commands :
>
>    ALTER DATABASE ; ALTER TRIGGER ; CHECKPOINT ; CREATE CAST ;
>    CREATE CONSTRAINT TRIGGER ; CREATE CONVERSION ; CREATE DOMAIN ;
>    CREATE LANGUAGE ; DEALLOCATE ; DROP CAST ; DROP CONVERSION ;
>    DROP DOMAIN ; DROP LANGUAGE ; EXECUTE ; PREPARE
>
> ( this could be considered a low priority todo item , though )

--
  Rod Taylor

Attachment

Re: psql tab completion

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Rod Taylor wrote:
> Clean up psql:
>
> Add simple ALTER DATABASE, ALTER TRIGGER, CHECK POINT, CREATE
> CONVERSION, CREATE DOMAIN, CREATE LANGUAGE, DEALLOCATE, DROP CONVERSION,
> DROP DOMAIN, DROP LANGUAGE, EXECUTE, PREPARE
>
> Complete CAST in CREATE CAST and DROP CAST but doesn't suggest what
> should follow.
>
> Add many more SET / SHOW variables to the list.  Taken from SHOW ALL
> output.
>
> Complete a case sensitive search to allow \dD, \dd, \dS, \ds, \h, \H to
> complete properly.  But there are no matches, then try a case
> insensitive search to allow case conversion.  Add all missing help
> options.
>
> \Q<tab>    -> \q
> \dD<tab>   -> \dD
> \dd<tab>   -> \dd
> \D<tab><tab><tab> -> \d (with listing of \d? commands)
> sel<tab>   -> SELECT
>
>
> > On the other hand, in psql , tab-completion doesn't seem to
> > work for certain commands :
> >
> >    ALTER DATABASE ; ALTER TRIGGER ; CHECKPOINT ; CREATE CAST ;
> >    CREATE CONSTRAINT TRIGGER ; CREATE CONVERSION ; CREATE DOMAIN ;
> >    CREATE LANGUAGE ; DEALLOCATE ; DROP CAST ; DROP CONVERSION ;
> >    DROP DOMAIN ; DROP LANGUAGE ; EXECUTE ; PREPARE
> >
> > ( this could be considered a low priority todo item , though )
>
> --
>   Rod Taylor

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: psql tab completion

From
Bruce Momjian
Date:
Nice comprehensive patch applied.  Thanks.

---------------------------------------------------------------------------


Rod Taylor wrote:
> Clean up psql:
>
> Add simple ALTER DATABASE, ALTER TRIGGER, CHECK POINT, CREATE
> CONVERSION, CREATE DOMAIN, CREATE LANGUAGE, DEALLOCATE, DROP CONVERSION,
> DROP DOMAIN, DROP LANGUAGE, EXECUTE, PREPARE
>
> Complete CAST in CREATE CAST and DROP CAST but doesn't suggest what
> should follow.
>
> Add many more SET / SHOW variables to the list.  Taken from SHOW ALL
> output.
>
> Complete a case sensitive search to allow \dD, \dd, \dS, \ds, \h, \H to
> complete properly.  But there are no matches, then try a case
> insensitive search to allow case conversion.  Add all missing help
> options.
>
> \Q<tab>    -> \q
> \dD<tab>   -> \dD
> \dd<tab>   -> \dd
> \D<tab><tab><tab> -> \d (with listing of \d? commands)
> sel<tab>   -> SELECT
>
>
> > On the other hand, in psql , tab-completion doesn't seem to
> > work for certain commands :
> >
> >    ALTER DATABASE ; ALTER TRIGGER ; CHECKPOINT ; CREATE CAST ;
> >    CREATE CONSTRAINT TRIGGER ; CREATE CONVERSION ; CREATE DOMAIN ;
> >    CREATE LANGUAGE ; DEALLOCATE ; DROP CAST ; DROP CONVERSION ;
> >    DROP DOMAIN ; DROP LANGUAGE ; EXECUTE ; PREPARE
> >
> > ( this could be considered a low priority todo item , though )
>
> --
>   Rod Taylor

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073