Re: Proposal: new function array_init
От | Webb Sprague |
---|---|
Тема | Re: Proposal: new function array_init |
Дата | |
Msg-id | b11ea23c0806021018v5be4edb8v3a8294af766d5d0@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Proposal: new function array_init (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Mon, Jun 2, 2008 at 9:46 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > "Pavel Stehule" <pavel.stehule@gmail.com> writes: >> There was more time questions about array's initialisation. I propose >> function array_init. As one of the questioners, I will give some short thoughts below. >> CREATE OR REPLACE FUNCTION array_init(sizes int[], v anyelement) >> RETURNS anyarray; +1. +0 for Pavel's proposed syntax, because it feels better, but also it scales to N dimensions (we should throw an error obviously if the input is too big, but we can probably source that size through an include), I hate functions with more than four arguments, and having six slightly overloaded functions in the system catalogs seems annoying. > * We can handle a null fill value now, but what about nulls in the > dimensions? The alternatives seem to be to return a null array > (not an array of nulls) or throw error. I would throw an error, unless there is something that one can do with a null array (perhaps there is?). We also might want to consider a resize function, and some other utilities as long as we are bothering with this. I am sorry that I can't offer to write these, but I don't have the time to learn the Postgresql infrastructure to do it. Thanks for the attention Pavel!
В списке pgsql-hackers по дате отправления: