Skip site navigation (1) Skip section navigation (2)

Re: surppressing column names in COPY format

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "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:33:29
Message-ID: 1059683609.22260.1617.camel@camel (view raw or flat)
Thread:
Lists: pgsql-general
On Thu, 2003-07-31 at 15:18, 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.

that was an example table, the actual table has millions of rows, I need
to use COPY on it.

> 
> 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.
> 

By that logic then what is the point of allowing data dumped as INSERTS
both with and without column names? Obviously there is functionality to
be gained (or lost) doing it with or without column names, and in the
current case I'm not gaining anything by having the columns explicitly
named, so a flag to turn them off would be handy. 

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2003-07-31 20:50:37
Subject: Re: surppressing column names in COPY format
Previous:From: Dennis GearonDate: 2003-07-31 20:20:49
Subject: Re: surppressing column names in COPY format

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group