From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | fabriziomello(at)gmail(dot)com |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal or just idea for psql - show first N rows from relation backslash statement |
Date: | 2013-02-14 07:25:27 |
Message-ID: | CAFj8pRBjTwsXx4KfzFJW-D0-KnwntW2mgypR6LexGsch5ML8Yw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
>
>
> I liked this idea, but thinking better we can implement a way to users
> create your own meta-commands to run:
>
> * another meta commands (like an alias)
> * SRFs
> * arbitrary SQLs
>
> All of them must accept arguments... some like this:
>
> \mset vt :table :rows 'select * from :table limit :rows'
>
> Then we can do exactly what you need:
>
> \vt foo 10
>
> \unset vt
>
> I don't know if it's a desired feature but I would love if it exists.
>
few year ago I proposed a implementation of macros - and I wrote a
prototype - enhanced psql
http://okbob.blogspot.cz/search?q=epsql
but now I don't think so enhancing psql in this direction is good way.
Enhanced console needs creating from scratch - it should be based on
some interpret language - LUA or javascript - probably it can be
better integrated to modern UI, can better do autocomplete - and this
design is out of my time possibilities and out of my targets.
Native implementation of \vt is terrible simple - and it is generic
and usual task
check it, please
Regards
Pavel
p.s. some simple form of bash alias command can be implemented, but
probably without autocomplete support
p.s.2. inside quotes or double quotes variables substitution doesn't work
> Best regards,
>
> --
> Fabrízio de Royes Mello
> Consultoria/Coaching PostgreSQL
>>> Blog sobre TI: http://fabriziomello.blogspot.com
>>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>>> Twitter: http://twitter.com/fabriziomello
Attachment | Content-Type | Size |
---|---|---|
vt.patch | application/octet-stream | 2.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2013-02-14 08:25:07 | Re: [COMMITTERS] pgsql: Create libpgcommon, and move pg_malloc et al to it |
Previous Message | Alexander Law | 2013-02-14 07:11:13 | Re: BUG #7493: Postmaster messages unreadable in a Windows console |