Re: Idea for making COPY data Microsoft-proof - Mailing list pgsql-hackers

From Philip Warner
Subject Re: Idea for making COPY data Microsoft-proof
Date
Msg-id 3.0.5.32.20020212111524.01cdb2f0@mail.rhyme.com.au
Whole thread Raw
In response to Re: Idea for making COPY data Microsoft-proof  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
At 07:02 PM 2/11/02 -0500, Tom Lane wrote:
>To take just one problem: how do I know that
>the first line is metadata, and not data that happens to look exactly
>like whatever my metadata layout is?

You don't, which is why you need the 'WITH HEADER' or 'WITH ENCODING'
clause on COPY. I guess COPY could issue a warning when you do not say WITH
HEADER and it looks like a valid header. 

Other than that, it's a case of storing information about the dumped data,
not the database schema in the data file. I'm not particularly attached to
the column names being there, but it does seem usefull to store
instructions indicating the the file is formatted.



----------------------------------------------------------------
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: Philip Warner
Date:
Subject: Re: Idea for making COPY data Microsoft-proof
Next
From: Tom Lane
Date:
Subject: Re: Idea for making COPY data Microsoft-proof