Re: [PATCHES] WITH DELIMITERS in COPY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] WITH DELIMITERS in COPY
Date: 2002-04-14 17:46:39
Message-ID: Pine.LNX.4.30.0204141343470.717-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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(at)gmx(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-04-14 18:13:21 Re: DROP COLUMN (was RFC: Restructuring pg_aggregate)
Previous Message Tom Lane 2002-04-14 17:37:18 Re: 7.2 crash...

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-04-14 18:08:45 Re: BETWEEN Help
Previous Message Gavin Sherry 2002-04-14 17:34:06 Re: [PATCHES] WITH DELIMITERS in COPY