Re: surppressing column names in COPY format

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: surppressing column names in COPY format
Date: 2003-07-31 20:20:49
Message-ID: 3F297A21.4000501@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wonder if there's a way to just 'append' a temp table to another table, as long as the column's have the exact same type and order and don't violate constraints. It would have to be with the db shutdown probably.

Tom Lane wrote:
> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
>
>>the problem is that I am restoring the data to a database with different
>>column names, which errors out in 7.3 (but didn't under 7.2 since it
>>didn't produce column names in the COPY output). I checked the docs and
>>it provided no clue as to how to suppress column names for COPY only
>>dumps.
>
>
> I think you can still get it to dump as INSERTs without column names.
>
> I don't really agree that we've "lost functionality" here, though ---
> you might as well claim that it's a bug that the COPY command forces
> you to restore the data into a particular table. If you need to do
> data transformation (which includes relabeling columns IMHO), restore
> the data into a temp table and then do INSERT ... SELECT ... to massage
> it into what you want.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2003-07-31 20:33:29 Re: surppressing column names in COPY format
Previous Message Joe Conway 2003-07-31 20:10:36 Re: preload libraries patch [was: [GENERAL] hexadecimal to decimal]