From: | "Daniel Verite" <daniel(at)manitou-mail(dot)org> |
---|---|
To: | "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | "corey(dot)huinker" <corey(dot)huinker(at)gmail(dot)com>,"David Fetter" <david(at)fetter(dot)org>,nasbyj(at)amazon(dot)com,"Surafel Temsgen" <surafel3000(at)gmail(dot)com>,"Christoph Moench-Tegeder" <cmt(at)burggraben(dot)net>,"PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: COPY FROM WHEN condition |
Date: | 2018-11-02 11:58:12 |
Message-ID: | b66941d6-fb91-47a0-9e9e-a06075ffb58d@manitou-mail.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Pavel Stehule wrote:
> > SELECT x.a, sum(x.b)
> > FROM ( COPY INLINE '/path/to/foo.txt' FORMAT CSV ) as x( a integer, b
> > numeric, c text, d date, e json) )
> > WHERE x.d >= '2018-11-01'
> >
> >
> Without some special feature this example is not extra useful. It is based
> on copy on server that can use only super user with full rights.
And if superuser, one might use the file data wrapper [1] to get
the same results without the need for the explicit COPY in the query.
BTW, this brings into question whether the [WHEN condition] clause
should be included in the options of file_fdw, as it supports pretty
much all COPY options.
Also, psql's \copy should gain the option too?
[1] https://www.postgresql.org/docs/current/static/file-fdw.html
Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Verite | 2018-11-02 12:35:26 | Re: csv format for psql |
Previous Message | Surafel Temesgen | 2018-11-02 11:23:19 | Re: COPY FROM WHEN condition |