Skip site navigation (1) Skip section navigation (2)

Re: 7.4 COPY BINARY Format Change

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: 7.4 COPY BINARY Format Change
Date: 2003-08-01 16:35:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Lee Kindness <lkindness(at)csl(dot)co(dot)uk> writes:
> I've attached a patch which lets COPY read in the 7.1 format. However
> i'm not convinced this is the right way to go - I think the format
> which is output by 7.4 should be identical to the 7.1 format.

You are greatly underestimating the changes that occurred in COPY BINARY.
If the format difference had been as minor as you think, I would not
have gratuitously broken compatibility.

The real change that occurred here is that the individual data fields
go through per-datatype send/receive routines, which in addition to
implementing a mostly machine-independent binary format also provide
defenses against bad input data.

To continue to read the old COPY BINARY format, we'd have to bypass
those routines and allow direct read of the internal data formats.
This was a security risk before and would be a much bigger one now,
seeing that we allow COPY BINARY FROM STDIN to unprivileged users.  It
is trivial to crash the backend by feeding it bad internal-format data.

(I don't believe that the patch works anyway, given that you aren't doing
anything to disable use of the per-datatype receive routine.  It might
work as-is for text fields, and for integers on bigendian machines, but
not for much else.)

We are not going back to the pre-7.4 format.  Sorry.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Joe ConwayDate: 2003-08-01 17:11:44
Subject: cvs head compile failure
Previous:From: Peter EisentrautDate: 2003-08-01 15:52:26
Subject: Re: contrib compilation probs

pgsql-patches by date

Next:From: Serguei A. MokhovDate: 2003-08-01 16:45:15
Subject: Re: [pgsql-rus] Russian NLS update: pg_dump, libpq,
Previous:From: Peter EisentrautDate: 2003-08-01 16:19:38
Subject: Re: Russian NLS Update: psql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group