Re: proposal \gcsv - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: proposal \gcsv
Date
Msg-id 20200401180931.GA25309@alvherre.pgsql
Whole thread Raw
In response to Re: proposal \gcsv  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal \gcsv  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
On 2020-Apr-01, Pavel Stehule wrote:

> It can work, but it is not user friendly - my proposal was motivated by
> using some quick csv exports to gplot's pipe.

Can we fix that by adding some syntax to allow command aliases?
So you could add to your .psqlrc something like

\alias \gcsv \pset push all \; \cbuf; \; \pset pop

where the \cbuf is a hypothetical "function" that expands to the current
query buffer.  This needs some refining I guess, but it'd allow you to
create your own shortcuts for the most common features you want without
excessive typing effort.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: snapshot too old issues, first around wraparound and then more.
Next
From: Andres Freund
Date:
Subject: Re: snapshot too old issues, first around wraparound and then more.