Re: array_length(anyarray)
От
Marko Tiikkaja
Тема
Re: array_length(anyarray)
Дата
Msg-id
52B215DE.40409@joh.to
Ответ на
Re: array_length(anyarray) (Andrew Dunstan)
Список
Дерево обсуждения
array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) David Fetter <david@fetter.org>
Re: array_length(anyarray) Pavel Stehule <pavel.stehule@gmail.com>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Pavel Stehule <pavel.stehule@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Pavel Stehule <pavel.stehule@gmail.com>
Re: array_length(anyarray) Robert Haas <robertmhaas@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Pavel Stehule <pavel.stehule@gmail.com>
Re: array_length(anyarray) Florian Pflug <fgp@phlo.org>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Jim Nasby <jim@nasby.net>
Re: array_length(anyarray) Florian Pflug <fgp@phlo.org>
Re: array_length(anyarray) Merlin Moncure <mmoncure@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Dean Rasheed <dean.a.rasheed@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Merlin Moncure <mmoncure@gmail.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Merlin Moncure <mmoncure@gmail.com>
Re: array_length(anyarray) Florian Pflug <fgp@phlo.org>
Re: array_length(anyarray) Merlin Moncure <mmoncure@gmail.com>
Re: array_length(anyarray) Florian Pflug <fgp@phlo.org>
Re: array_length(anyarray) Andrew Dunstan <andrew@dunslane.net>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) Andrew Dunstan <andrew@dunslane.net>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
Re: array_length(anyarray) David Johnston <polobo@yahoo.com>
Re: array_length(anyarray) Marko Tiikkaja <marko@joh.to>
On 2013-12-18 22:32, Andrew Dunstan wrote: > You're not really free to assume it - you'll need an exception handler > for the other-than-1 case, or your code might blow up. > > This seems to be codifying a bad pattern, which should be using > array_lower() and array_upper() instead. That's the entire point -- I *want* my code to blow up. If someone passes a multi-dimensional array to a function that assumes its input is one-dimensional and its indexes start from 1, I want it to be obvious that the caller did something wrong. Now I either copy-paste lines and lines of codes to always test for the weird cases or my code breaks in subtle ways. This is no different from an Assert() somewhere -- if the caller breaks the documented interface, it's his problem, not mine. And I don't want to waste my time coding around the fact that this simple thing is so hard to do in PG. Regards, Marko Tiikkaja
В списке pgsql-hackers по дате отправления