2008/6/5 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> postgres=# select array_fill('p',array[4,4]);
>> ERROR: could not determine polymorphic type because input has type "unknown"
>
> [ shrug... ] I don't really see a problem with that.
you have t cast in most
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> postgres=# select array_fill('p',array[4,4]);
> ERROR: could not determine polymorphic type because input has type "unknown"
[ shrug... ] I don't really see a problem with that.
> I can use hack:
> CREATE OR REPLACE FUNCTION array_fill(dv text, dim
2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> idealized code:
>
>> a = array_set(array[10,10]); // untyped null array
>> a[10,10] = 'text'; -- now array is typed
>
> And how did you declare 'a'? This seems like a solution in search of a
> problem.
>
you ha
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> idealized code:
> a = array_set(array[10,10]); // untyped null array
> a[10,10] = 'text'; -- now array is typed
And how did you declare 'a'? This seems like a solution in search of a
problem.
regards, tom lane
--
Sent via p
2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> 2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
>>> If you mean an array of nulls, it still has to have an element type.
>
>> I know it - but there was discus about untyped array for empty arrays
>> like ARRAY[]
>
> Wha
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> 2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
>> If you mean an array of nulls, it still has to have an element type.
> I know it - but there was discus about untyped array for empty arrays
> like ARRAY[]
What's that have to do with array_init? It will not
Tom Lane wrote:
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
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
2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> 2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
>>> 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.
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> 2008/6/4 Tom Lane <[EMAIL PROTECTED]>:
>> 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?
If
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, i
"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?
The fact that
2008/6/4 Decibel! <[EMAIL PROTECTED]>:
> On Jun 2, 2008, at 11:46 AM, Tom Lane wrote:
>>
>> * Should the fill value be the first parameter instead of the last?
>
>
> +1. The other way just seems weird, at least to me.
can you write reason?
I put fill value on end, because it is like default value
On Jun 2, 2008, at 11:46 AM, Tom Lane wrote:
* Should the fill value be the first parameter instead of the last?
+1. The other way just seems weird, at least to me.
--
Decibel!, aka Jim C. Nasby, Database Architect [EMAIL PROTECTED]
Give your computer some brain candy! www.distributed.net Tea
On Mon, Jun 02, 2008 at 08:10:19PM +0200, Pavel Stehule wrote:
> > * I have a mild preference for "array_fill" instead of "array_init".
>
> maybe, maybe array_set. Any ideas are welcome
array_create?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your s
2008/6/2 Tom Lane <[EMAIL PROTECTED]>:
> "Pavel Stehule" <[EMAIL PROTECTED]> writes:
>> There was more time questions about array's initialisation. I propose
>> function array_init.
>
>> CREATE OR REPLACE FUNCTION array_init(sizes int[], v anyelement)
>> RETURNS anyarray;
>
> I think this is basica
On Mon, Jun 2, 2008 at 9:46 AM, Tom Lane <[EMAIL PROTECTED]> wrote:
> "Pavel Stehule" <[EMAIL PROTECTED]> 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
"Pavel Stehule" <[EMAIL PROTECTED]> writes:
> There was more time questions about array's initialisation. I propose
> function array_init.
> CREATE OR REPLACE FUNCTION array_init(sizes int[], v anyelement)
> RETURNS anyarray;
I think this is basically a good idea, but maybe the API needs a bit of
Hello
There was more time questions about array's initialisation. I propose
function array_init.
CREATE OR REPLACE FUNCTION array_init(sizes int[], v anyelement)
RETURNS anyarray;
First parameter is array of dimension's sizes. Second argument is
value that will be used for initialisation.
Becau
18 matches
Mail list logo