Re: SQL/MED - file_fdw - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: SQL/MED - file_fdw
Date
Msg-id AANLkTikCt6bHXZjO_oX+JS7+G=jAQ7gVZPu0Owjcsbfb@mail.gmail.com
Whole thread Raw
In response to SQL/MED - file_fdw  (Shigeru HANADA <hanada@metrosystems.co.jp>)
Responses Re: SQL/MED - file_fdw  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
2010/11/25 Shigeru HANADA <hanada@metrosystems.co.jp>:
> Hi, hackers,
>
> Attached is a patch that adds file_fdw, FDW which reads records from
> files on the server side, as a contrib module.  This patch is based on
> "SQL/MED core functionality" patch.
>
> [SQL/MED - core functionality]
> http://archives.postgresql.org/pgsql-hackers/2010-11/msg01698.php
>
> File_fdw can be installed with the steps similar to other contrib
> modules, and you can create FDW with the script:
>    $SHAREDIR/contrib/file_fdw.sql
> Note that you need to create file_fdw for each database.
>
> Document for file_fdw is included in the patch, although the contents
> might not be enough.
>
> Any comments and questions are welcome.

I think it is better to add encoding option to FileFdwOption. In the
patch the encoding of file is assumed as client_encoding, but we may
want to SELECT from different-encoded csv in a query.

Apart from the issue with fdw, I've been thinking client_encoding for
COPY is not appropriate in any way. client_encoding is the encoding of
the statement the client sends, not the COPY target which is on the
server's filesystem. Adding encoding option to COPY will eliminate
allowEncodingChanges option from JDBC driver.

Regards,



--
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: pg_execute_from_file review
Next
From: Heikki Linnakangas
Date:
Subject: Re: Comment typo in xlog.c