Re: Alternative to \copy in psql modelled after \g

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Alternative to \copy in psql modelled after \g
Date: 2018-11-09 16:16:16
Message-ID: CAKFQuwa6V-2aNna4o+A1fYfiPZw5A-RWYNb=3YVUqeg1oq76cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 9, 2018 at 4:19 AM Daniel Verite <daniel(at)manitou-mail(dot)org> wrote:
> Examples of use
>
> 1. $ psql -v filename="/path/data-$(date -I).csv"
> COPY (SELECT *
> FROM table
> WHERE ...)
> TO STDOUT (FORMAT csv) \copyto :filename

Do I understand correctly that you are proposing a slightly less
verbose alternative of:

\o :filename
COPY TO STDOUT
\o

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-09 16:16:24 Re: notice processors for isolationtester
Previous Message Konstantin Knizhnik 2018-11-09 16:08:58 Re: [HACKERS] Surjective functional indexes