Re: duplicate columns with COPY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 16:03:55
Message-ID: 12281.1198166635@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> 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?

I think it's reasonable even for COPY TO, since IMHO the odds that it's
a typo, rather than intentional, are probably 100:1.

As already noted, we do have a workaround if that is truly what you
intend.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Arunachalam Parthasarathy 2007-12-20 17:35:03 query : max size Bytea
Previous Message Magnus Hagander 2007-12-20 16:01:22 Re: pgwin32_open returning EINVAL