Re: 7.2 - changed array_out() - quotes vs no quotes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 7.2 - changed array_out() - quotes vs no quotes
Дата
Msg-id 21642.1013146186@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 7.2 - changed array_out() - quotes vs no quotes  (David Gould <dg@nextbus.com>)
Ответы Re: 7.2 - changed array_out() - quotes vs no quotes  (David Gould <dg@nextbus.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: aggregate functions only for numbers?
Следующее
От: Darren Johnson
Дата:
Сообщение: Re: Replication