On Thu, Jun 2, 2016 at 4:48 PM, Corey Huinker <corey.huin...@gmail.com> wrote: > A while back, there was a push to make COPY gzip-aware. That didn't happen, > but COPY FROM PROGRAM did, and it scratches the same itch. > > I have a similar need, but with file_fdw foreign tables. I have .csv.gz > files downloaded to the server, but those CSVs have 100+ columns in them, > and in this case I only really care about a half dozen of those columns. I'd > like to avoid: > - the overhead of writing the uncompressed file to disk and then immediately > re-reading it > - writing unwanted columns to a temp/work table via COPY, and then > immediately re-reading them > - multicorn fdw because it ends up making a python string out of all data > cells > - a csv parsing tool like csvtool or mlr, because they output another CSV > which must be reparsed from scratch > > Since file_fdw leverages COPY, it seemed like it would be easy to add the > FROM PROGRAM feature to file_fdw. I began asking questions on #postgresql > IRC, only to discover that Adam Gomaa ( akgo...@gmail.com ) had already > written such a thing, but hadn't submitted it. Attached is a small rework of > his patch, along with documentation.
His failure to submit that here himself raises the question of whether he is OK with that code being released under the PostgreSQL license. If this patch is going to be considered, I think we should have a post from him clarifying that matter. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers