Bruce Momjian <[EMAIL PROTECTED]> writes:
> FYI, Tom, old email from Feb 1, 2006, from your server:
Wups. Sorry about that --- somehow I confused that with the current
thread about copy delimiters. Should have looked harder at the date.
regards, tom lane
---
cc: David Fetter <[EMAIL PROTECTED]>, Andrew Dunstan <[EMAIL
PROTECTED]>,
[EMAIL PROTECTED], PostgreSQL-patches
Subject: Re: [PATCHES] [BUGS] BUG #2221: Bad delimiters allowed in COPY
...
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL
Bruce Momjian writes:
> Attached is a patch that errors for \r and \n in delimiter and
> null.
I am not convinced that this is a bug. Can you prove that there is no
use-case for asking COPY to emit data in this style? Sure, COPY itself
couldn't read it, but people sometimes feed COPY output to
David Fetter wrote:
> On Wed, Feb 01, 2006 at 01:16:08AM -0500, Tom Lane wrote:
> > Bruce Momjian writes:
> > > Attached is a patch that errors for \r and \n in delimiter and
> > > null. I kept the ERRCODE_FEATURE_NOT_SUPPORTED error code because
> > > that is what all the other error tests use i
David Fetter wrote:
Anyhow, Bruce's patch still allows backslash as a delimiter, which can
cause *all* kinds of fun if not disallowed.
Yes, I'm puzzled by that. I can't really see any case for allowing it.
And if we do, it should only be allowed in CSV mode, where its use will
be mere
On Wed, Feb 01, 2006 at 01:16:08AM -0500, Tom Lane wrote:
> Bruce Momjian writes:
> > Attached is a patch that errors for \r and \n in delimiter and
> > null. I kept the ERRCODE_FEATURE_NOT_SUPPORTED error code because
> > that is what all the other error tests use in the copy code in
> > that ar
Bruce Momjian writes:
> Attached is a patch that errors for \r and \n in delimiter and null. I
> kept the ERRCODE_FEATURE_NOT_SUPPORTED error code because that is what
> all the other error tests use in the copy code in that area.
I'd go with INVALID_PARAMETER_VALUE, I think. ISTM that
FEATURE_
> On Tue, Jan 31, 2006 at 09:50:26PM -0600, Andrew Dunstan wrote:
> > >> Also, should we disable DELIMITER and NULL from sharing characters?
> > >
> > > That's on about line 916, post-patch:
> > >
> > >/* Don't allow the delimiter to appear in the null string. */
> > >if (strchr(cstate->nul
On Tue, Jan 31, 2006 at 09:50:26PM -0600, Andrew Dunstan wrote:
> David Fetter said:
> > On Tue, Jan 31, 2006 at 08:03:41PM -0500, Bruce Momjian wrote:
> >> Uh, couldn't the delimiter be a backslash in CVS mode?
> >
> > I don't think so. Folks?
>
> Using backslash as a delimiter in CSV would be o
David Fetter said:
> On Tue, Jan 31, 2006 at 08:03:41PM -0500, Bruce Momjian wrote:
>> Uh, couldn't the delimiter be a backslash in CVS mode?
>
> I don't think so. Folks?
Using backslash as a delimiter in CSV would be odd, to say the least. As an
escape char it is occasionally used, but not as a
On Tue, Jan 31, 2006 at 08:03:41PM -0500, Bruce Momjian wrote:
> Uh, couldn't the delimiter be a backslash in CVS mode?
I don't think so. Folks?
Anyhow, if there are different sets, I could do something like:
#define BADCHARS "\r\n\\"
#define BADCHARS_CSV "\r\n"
and then check for csv_mode, et
Uh, couldn't the delimiter be a backslash in CVS mode?
+ #define BADCHARS "\r\n\\"
Also, should we disable DELIMITER and NULL from sharing characters?
---
David Fetter wrote:
> On Sun, Jan 29, 2006 at 10:20:47PM -0
> Is ERRCODE_FEATURE_NOT_SUPPORTED the right errcode? This isn't a
> missing feature; we are performing a sanity check here. We can
> reasonably expect never to support CR, LF or \ as the text
> delimiter.
I guess that depends on whether we ever plan to allow people to set
the output record separ
On Mon, Jan 30, 2006 at 08:21:34AM -0500, Andrew Dunstan wrote:
>
>
> David Fetter wrote:
>
> >
> >+/* Disallow BADCHARS characters */
> >+if (strcspn(cstate->delim, BADCHARS) != 1)
> >+ereport(ERROR,
> >+(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
>
David Fetter wrote:
+ /* Disallow BADCHARS characters */
+ if (strcspn(cstate->delim, BADCHARS) != 1)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+errmsg("COPY delimiter cannot be \"%#02x\"",
+
On Sun, Jan 29, 2006 at 10:20:47PM -0500, Neil Conway wrote:
> On Sun, 2006-01-29 at 17:03 -0800, David Fetter wrote:
> > Another followup, this time with the comment done right.
>
> + /* Disallow the forbidden_delimiter strings */
> + if (strcspn(cstate->delim, BADCHARS) != 1)
> +
On Sun, 2006-01-29 at 17:03 -0800, David Fetter wrote:
> Another followup, this time with the comment done right.
+ /* Disallow the forbidden_delimiter strings */
+ if (strcspn(cstate->delim, BADCHARS) != 1)
+ elog(ERROR, "COPY delimiter cannot be %#02x",
+
On Sun, Jan 29, 2006 at 04:41:43PM -0800, David Fetter wrote:
> On Sun, Jan 29, 2006 at 09:50:08PM +, David Fetter wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: 2221
> > Logged by: David Fetter
> > Email address: [EMAIL PROTECTED]
> > Postg
On Sun, Jan 29, 2006 at 09:50:08PM +, David Fetter wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2221
> Logged by: David Fetter
> Email address: [EMAIL PROTECTED]
> PostgreSQL version: all
> Operating system: all
> Description:Bad delimit
19 matches
Mail list logo