COPY improvements

Started by Neil Conwayabout 24 years ago6 messagespatches
Jump to latest
#1Neil Conway
neilc@samurai.com

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I also restructed a lot of the existing COPY code, did some code
review on the column list patch sent in by Brent Verner a little
while ago, and added some regression tests. I also added an
explicit check (and resultant error) for extra data before
the end-of-line.

Since COPY is pretty important, I think this should be tested
pretty well before we release 7.3.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachments:

copy-cleanup-3.patchtext/plain; charset=us-asciiDownload+430-403
#2Neil Conway
neilc@samurai.com
In reply to: Neil Conway (#1)
Re: COPY improvements

On Thu, Jul 25, 2002 at 04:25:35PM -0400, Neil Conway wrote:

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I've attached an improved patch. This patch fixes a regression test
failure in the previous patch, updates the documentation for the
new behavior of COPY, and makes the handling of COPY TO/FROM
WITH OIDS into a table without OIDs more consistent (plus regression
tests for the same).

I'm not sure if the "bail out if we encounter extra data" check
is too strict -- any comments?

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachments:

copy-cleanup-4.patchtext/plain; charset=us-asciiDownload+482-441
#3Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: COPY improvements

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Neil Conway wrote:

On Thu, Jul 25, 2002 at 04:25:35PM -0400, Neil Conway wrote:

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I've attached an improved patch. This patch fixes a regression test
failure in the previous patch, updates the documentation for the
new behavior of COPY, and makes the handling of COPY TO/FROM
WITH OIDS into a table without OIDs more consistent (plus regression
tests for the same).

I'm not sure if the "bail out if we encounter extra data" check
is too strict -- any comments?

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#1)
Re: COPY improvements

IMPROVED VERSION APPLIED.

Patch applied. Thanks.

---------------------------------------------------------------------------

Neil Conway wrote:

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I also restructed a lot of the existing COPY code, did some code
review on the column list patch sent in by Brent Verner a little
while ago, and added some regression tests. I also added an
explicit check (and resultant error) for extra data before
the end-of-line.

Since COPY is pretty important, I think this should be tested
pretty well before we release 7.3.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#5Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: COPY improvements

This is the one I actually applied.

---------------------------------------------------------------------------

Neil Conway wrote:

On Thu, Jul 25, 2002 at 04:25:35PM -0400, Neil Conway wrote:

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I've attached an improved patch. This patch fixes a regression test
failure in the previous patch, updates the documentation for the
new behavior of COPY, and makes the handling of COPY TO/FROM
WITH OIDS into a table without OIDs more consistent (plus regression
tests for the same).

I'm not sure if the "bail out if we encounter extra data" check
is too strict -- any comments?

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#6Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: COPY improvements

Neil Conway wrote:

On Thu, Jul 25, 2002 at 04:25:35PM -0400, Neil Conway wrote:

The attached patch completes the following TODO item:

* Generate failure on short COPY lines rather than pad NULLs

I've attached an improved patch. This patch fixes a regression test
failure in the previous patch, updates the documentation for the
new behavior of COPY, and makes the handling of COPY TO/FROM
WITH OIDS into a table without OIDs more consistent (plus regression
tests for the same).

I'm not sure if the "bail out if we encounter extra data" check
is too strict -- any comments?

If the COPY row has too little data or too much data, you have to abort
the COPY.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026