Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>, Kris Jurka <books(at)ejurka(dot)com>
Subject: Re: [PATCHES] [BUGS] casting strings to multidimensional arrays yields strange
Date: 2004-08-06 00:17:30
Message-ID: 4201.1091751450@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:
> ... whitespace just before the delimiter is
> significant (even though leading whitespace is not)

Yeah. This has been the documented behavior for quite some time, but
I can't say that I ever liked it.

> I view the current behavior as a bug. While making changes, I'd like to
> require elements with embedded whitespace to be quoted so that the above
> does this:

> regression=# select '{0 second,0 second}'::text[];
> ERROR: malformed array literal: "{0 second,0 second}"

> Additionally I'd like to make whitespace before and after quoted or
> unquoted elements insignificant. Any comments?

I think that suppressing unquoted trailing whitespace is probably
reasonable. I'm much less enthusiastic about rejecting unquoted
embedded whitespace, though. I think that's significantly likely
to break apps, and it doesn't seem like it's really needed to have
sane behavior. The leading/trailing whitespace asymmetry is just
weird, but it doesn't follow that embedded whitespace is weird.

If we are going to make such changes, 8.0 is the right time to do it.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2004-08-06 04:56:23 Re: unicode strings are not sorted alphabetically
Previous Message Tom Lane 2004-08-06 00:00:26 Re: BUG #1206: sig fault 12 and core dumps using conflux

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2004-08-06 00:25:53 Re: 8.0 beta status
Previous Message Tom Lane 2004-08-05 23:58:14 8.0 beta status

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-08-06 00:25:48 Re: Autovacuum Integration Patch Take 5
Previous Message Matthew T. O'Connor 2004-08-06 00:10:37 Re: Autovacuum Integration Patch Take 5