Re: Add switches for DELIMITER and NULL in pg_dump COPY

From: Greg Stark <gsstark(at)mit(dot)edu>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Add switches for DELIMITER and NULL in pg_dump COPY
Date: 2006-03-08 17:03:07
Message-ID: 87wtf4na2c.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


David Fetter <david(at)fetter(dot)org> writes:

> Not everybody's editor/mailer/whatever does this right, and it makes
> things fragile. Another way to do this is to change the delimter to a
> printable character like '|', but that raises hackles, too.

Frankly if you're passing you data through an editor/mailer/whatever you don't
trust then your setup is already fragile. At least if you're using tabs then
you find out about these problems. Tiptoeing around the untrustworthy process
just means that it'll fail randomly (and unpredictably) when other characters
appear in the data that the software doesn't handle.

There are certainly cases where you'll need to do this to interface with other
(amateurish) software. But pg_dump isn't for that at all. Even COPY isn't a
general purpose data formatter. To interface with other software not using a
standard format you're going to have to pass the data through Perl or
something like that anyways.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ben Chelf 2006-03-08 17:20:24 Re: Coverity Open Source Defect Scan of PostgreSQL
Previous Message Simon Riggs 2006-03-08 16:41:34 Re: problem with large maintenance_work_mem settings and

Browse pgsql-patches by date

  From Date Subject
Next Message Andreas Pflug 2006-03-08 18:27:20 Re: CREATE SYNONYM ...
Previous Message David Fetter 2006-03-08 16:29:55 Re: Add switches for DELIMITER and NULL in pg_dump COPY