Re: [PATCHES] WITH DELIMITERS in COPY - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCHES] WITH DELIMITERS in COPY
Date
Msg-id Pine.LNX.4.30.0204141343470.717-100000@peter.localdomain
Whole thread Raw
In response to Re: [PATCHES] WITH DELIMITERS in COPY  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
Gavin Sherry writes:

> The patch attached maintains backward compatibility. The syntax is as
> follows:
>
> COPY [BINARY] <relname> [WITH OIDS] FROM/TO
>               [USING DELIMITERS <delimiter>]
>               [WITH [ DELIMITER <delimiter> | NULL AS <char> | OIDS ]]

I think we should lose the WITH altogether.  It's not any better than
USING.

But just saying "OIDS" is not very clear.  In this case the WITH is
necessary.

> Note that if you execute a query such as:
>
> COPY pg_class TO '/some/path/file/out'
>     USING DELIMITERS <tab>
>     WITH DELIMITER '|';
>
> The code will give preference to WITH DELIMITER.

That should be an error.

> If no one can find fault with this or my implementation, I'll follow up
> with documentation and psql patches (not sure that there is much point
> patching pg_dump).

pg_dump should use the new syntax.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: [PATCHES] WITH DELIMITERS in COPY
Next
From: Tom Lane
Date:
Subject: Re: DROP COLUMN (was RFC: Restructuring pg_aggregate)