Re: 7.2 - changed array_out() - quotes vs no quotes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 7.2 - changed array_out() - quotes vs no quotes
Date
Msg-id 21642.1013146186@sss.pgh.pa.us
Whole thread Raw
In response to 7.2 - changed array_out() - quotes vs no quotes  (David Gould <dg@nextbus.com>)
Responses Re: 7.2 - changed array_out() - quotes vs no quotes  (David Gould <dg@nextbus.com>)
List pgsql-hackers
David Gould <dg@nextbus.com> writes:
> Somewhere after 7.2b2 (it looks like for 7.2b4) a change was made to
> array_out() in:

I will take the blame for that.

> I view this change as a bug and would like to see it backed out. 

The old behavior was certainly broken and I will not accept a proposal
to back out the change entirely.

What you are really saying is that you'd prefer the choice of quotes or
no quotes to be driven by the datatype rather than by the data value.
That's a legitimate gripe, but where shall we get the knowledge of whether
the datatype might sometimes emit strings that need quoting?  Using the
pass-by-reference flag is *completely* wrong; the fact that it chanced
not to fail in your application does not make it less wrong.

The only way I could see to make the behavior totally predictable at
the datatype level (while not being broken) is to always quote every
array element.  However, that would likely break some other people's
oversimplified parsers, so I'm not convinced it's a net win.  Perhaps
you should fix your application code rather than relying on a
never-documented behavior.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: aggregate functions only for numbers?
Next
From: Darren Johnson
Date:
Subject: Re: Replication