Re: Implicit casts with generic arrays

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Implicit casts with generic arrays
Дата
Msg-id 29012.1172602246@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Implicit casts with generic arrays  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Implicit casts with generic arrays
Re: Implicit casts with generic arrays
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I've looked into cutting back on the implicit casts to text, which 
> exposed the following little gem.

> The expressions
> 'abc' || 34
> 34 || 'abc'
> would no longer work, with the following error message:
> ERROR:  22P02: array value must start with "{" or dimension information

Hm, that's annoying.  Not that the expressions fail --- we want them to
--- but that the error message is so unhelpful.

Since ANYARRAY is already special to the type system, I don't have a
problem with inserting some special case to prevent this, but I'm not
sure what the special case should be.  Is it too klugy to say "don't
implicitly cast unknown to anyarray unless the literal's value starts
with { or ["?  We've never made casting decisions depend on the contents
of strings before, and I'm really loath to make 'em do so now.

Seems basically we'd want to not cast unknown to anyarray unless there
is some additional bit of context suggesting that that's the right thing.
But what should that extra requirement be?  Can we go as far as not
doing this cast implicitly at all?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: COMMIT NOWAIT Performance Option
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: 7.x horology regression test on Solaris buildfarm machines