Re: proposal or just idea for psql - show first N rows from relation backslash statement - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal or just idea for psql - show first N rows from relation backslash statement
Date
Msg-id CAFj8pRBjTwsXx4KfzFJW-D0-KnwntW2mgypR6LexGsch5ML8Yw@mail.gmail.com
Whole thread Raw
In response to Re: proposal or just idea for psql - show first N rows from relation backslash statement  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: proposal or just idea for psql - show first N rows from relation backslash statement  (Stephen Frost <sfrost@snowman.net>)
Re: proposal or just idea for psql - show first N rows from relation backslash statement  (Merlin Moncure <mmoncure@gmail.com>)
List 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

pgsql-hackers by date:

Previous
From: Alexander Law
Date:
Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
Next
From: Heikki Linnakangas
Date:
Subject: Re: [COMMITTERS] pgsql: Create libpgcommon, and move pg_malloc et al to it