Re: duplicate columns with COPY

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: duplicate columns with COPY
Date: 2007-12-20 14:01:47
Message-ID: 476A75CB.6080102@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message NikhilS 2007-12-20 14:08:36 Re: duplicate columns with COPY
Previous Message Peter Eisentraut 2007-12-20 13:28:30 duplicate columns with COPY