Re: Edge case problem with pg_dump - Mailing list pgsql-hackers

From Philip Warner
Subject Re: Edge case problem with pg_dump
Date
Msg-id 5.1.0.14.0.20020525162306.03929520@mail.rhyme.com.au
Whole thread Raw
In response to Re: Edge case problem with pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Edge case problem with pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 10:51 23/05/02 -0400, Tom Lane wrote:
>"D'Arcy J.M. Cain" <darcy@druid.net> writes:
> > So who was it that wanted to make this change.  Perhaps I can help.
>
>I forget who had volunteered to work on it, but it was several months
>ago and nothing's happened ...

Not sure if this is the right reference, but about 30-Apr-2001, Alfred 
Perlstein raised the problem of column names in COPY, and you poured water 
on the idea:
    http://archives.postgresql.org/pgsql-hackers/2001-04/msg01132.php

ISTM that we do need *some* solution to the problem, and that based on your 
comments there are a couple of possibilities:

(a) AP: Allow COPY(OUT) to dump column info. Probably only the name of the 
column. Then (i'd guess) allow COPY(IN) to map named columns to new names,

(b) TL: One possibility is to fix ALTER TABLE ADD COLUMN to maintain the same
column ordering in parents and children.

At the time you stated that:
    COPY with specified columns may in fact be the best way to deal with    that particular issue, if pg_dump is all we
careabout fixing.  However    there are a bunch of things that have a problem with it, not only    pg_dump.  See thread
overin committers about functions and inheritance.
 

I'm not sure what these issues are, but it does seem to me that some more 
portable COPY format would be desirable and that solution (b) will not 
solve the problem if you are trying to restore a table that has had an attr 
deleted.

In your responses you also raised the problem of COPY having to know about 
default values for columns if we allow subsets of columns when we load 
data; does that mean that COPY does something more fancy than the 
equivalent of an INSERT?




----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/



pgsql-hackers by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: Redhat 7.3 time manipulation bug
Next
From: Oleg Bartunov
Date:
Subject: strange update problem with 7.2.1