Re: SQL/MED - file_fdw

From: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL/MED - file_fdw
Date: 2010-12-06 10:48:38
Message-ID: AANLkTikCt6bHXZjO_oX+JS7+G=jAQ7gVZPu0Owjcsbfb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/11/25 Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message flyusa2010 fly 2010-12-06 11:24:27 the number of file descriptors when using POSIX semaphore
Previous Message Dimitri Fontaine 2010-12-06 10:20:36 Re: pg_execute_from_file review