Re: RETURNING syntax for COPY - Mailing list pgsql-hackers

From Ryan Kelly
Subject Re: RETURNING syntax for COPY
Date
Msg-id 20130508194440.GC9650@llserver.lakeliving.com
Whole thread Raw
In response to Re: RETURNING syntax for COPY  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Wed, May 05/08/13, 2013 at 03:38:10PM -0400, Andrew Dunstan wrote:
> 
> On 05/08/2013 03:23 PM, Jim Nasby wrote:
> >>WITH new_data AS (
> >>    COPY FROM ...
> >>    RETURNING id, field_to_check
> >>)
> >
> 
> Why is this better than this, which you can do today?
> 
>    WITH new_data AS (
>         INSERT into ... FROM foreign_table_with_file_fdw RETURNING ...
>    )
> 
> 
> The whole reason I abandoned trying to do this sort of thing with
> COPY was that I realized the FDW would provide what I wanted.

You need to first CREATE EXTENSION file_fdw. Then you need to CREATE
SERVER. Then CREATE FOREIGN TABLE. Which requires appropriate permission
to do those things, and certainly has no hope of working on the client
side.

-Ryan P. Kelly




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: RETURNING syntax for COPY
Next
From: Jim Nasby
Date:
Subject: Re: GSOC Student Project Idea