Re: duplicate columns with COPY - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: duplicate columns with COPY
Date
Msg-id 476A75CB.6080102@dunslane.net
Whole thread Raw
In response to duplicate columns with COPY  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: duplicate columns with COPY  (NikhilS <nikkhils@gmail.com>)
List pgsql-hackers

Peter Eisentraut wrote:
> Is there a reason why COPY TO STDOUT does not allow columns to be specified 
> more than once?
>
> pei=# copy test1 (a, a) to stdout;
> ERROR:  42701: column "a" specified more than once
>
> Or is this just an overly extensive check that is actually intended for COPY 
> FROM STDIN?
>
>   

You should be able to get around it with:
 COPY (SELECT a , a FROM  test1) TO stdout;

cheers

andew


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: duplicate columns with COPY
Next
From: NikhilS
Date:
Subject: Re: duplicate columns with COPY