Re: Proposal: new function array_init - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Proposal: new function array_init
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: Proposal: new function array_init  (Tom Lane <[email protected]>)
Responses Re: Proposal: new function array_init
List pgsql-hackers
2008/6/4 Tom Lane <[email protected]>:
> "Pavel Stehule" <[email protected]> writes:
>> I put fill value on end, because it is like default value:
>
>> array_set(array[2,2]);
>> array_set(array[2,2], 0);
>
> Huh?  That's completely nonsensical ... where will you determine the
> type of the array, if you don't have a sample element?

it is nonsens in current postgres. But null array is castable to anyarray no?

>
> The fact that the fill value is determining the array type is why
> it seems important enough to put first.
>
I agree - first is most important parameter. But I am not sure, that
is it. size or value. An I am strong fixed on C, Intel notation where
destination is first and  value is second.

>                        regards, tom lane
>


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Overhauling GUCS
Next
From: Simon Riggs
Date:
Subject: Re: Change lock requirements for adding a trigger