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

From Shigeru HANADA
Subject Re: SQL/MED - file_fdw
Date
Msg-id 20101221201401.81B9.6989961C@metrosystems.co.jp
Whole thread Raw
In response to Re: SQL/MED - file_fdw  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: SQL/MED - file_fdw  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
List pgsql-hackers
On Mon, 20 Dec 2010 20:42:38 +0900
Itagaki Takahiro <itagaki.takahiro@gmail.com> wrote:
> On Sun, Dec 19, 2010 at 12:45, Robert Haas <robertmhaas@gmail.com> wrote:
> > I'm not questioning any of that.  But I'd like the resulting code to
> > be as maintainable as we can make it.
>
> I added comments and moved some setup codes for COPY TO to BeginCopyTo()
> for maintainability. CopyTo() still contains parts of initialization,
> but I've not touched it yet because we don't need the arrangement for now.

Attached is the revised version of file_fdw patch.  This patch is
based on Itagaki-san's copy_export-20101220.diff patch.

Changes from previous version are:

* file_fdw uses CopyErrorCallback() as error context callback routine
in fileIterate() to report error context.  "CONTEXT" line in the
example below is added by the callback.

    postgres=# select * From csv_tellers_bad;
    ERROR:  missing data for column "bid"
    CONTEXT:  COPY csv_tellers_bad, line 10: "10"
    postgres=#

* Only superusers can change table-level file_fdw options.  Normal
user can't change the options even if the user was the owner of the
table.  This is for security reason.

Regards,
--
Shigeru Hanada

Attachment

pgsql-hackers by date:

Previous
From: tv@fuzzy.cz
Date:
Subject: Re: proposal : cross-column stats
Next
From: Robert Haas
Date:
Subject: Re: proposal : cross-column stats