Re: proposal or just idea for psql - show first N rows from relation backslash statement
От | Fabrízio de Royes Mello |
---|---|
Тема | Re: proposal or just idea for psql - show first N rows from relation backslash statement |
Дата | |
Msg-id | CAFcNs+rHYDnp2aiMJs8i2Br=y+jygxKYWCTcrutv-RSCG+i_HQ@mail.gmail.com обсуждение исходный текст |
Ответ на | proposal or just idea for psql - show first N rows from relation backslash statement (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: proposal or just idea for psql - show first N rows from
relation backslash statement
|
Список | pgsql-hackers |
On Wed, Feb 13, 2013 at 6:07 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello
probably one from my top ten SQL statement will be
SELECT * FROM some_relation LIMIT 10
what do you thinking about creating special statement for this purpose?
possible syntax
-- ViewTable
\vt table_name [rows]
or
\sample table_name [rows]
a implementation with autocomplete is terrible simple
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.
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
В списке pgsql-hackers по дате отправления: