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

From Pavel Stehule
Subject Re: Proposal: new function array_init
Date
Msg-id 162867790806042059t3f6afdbci871fab3d459588d1@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: new function array_init  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2008/6/5 Tom Lane <tgl@sss.pgh.pa.us>:
> "Pavel Stehule" <pavel.stehule@gmail.com> 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 common case

>
>> I can use hack:
>> CREATE OR REPLACE FUNCTION array_fill(dv text, dims int[])
>> RETURNS text[]
>
> This would be a bad idea, I think; what will happen with
>
>        array_fill(null, array[1,2])

>
> I think we *want* that to throw error rather than defaulting to text.
>
>                        regards, tom lane
>

ok

Pavel


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Overhauling GUCS
Next
From: "Koichi Suzuki"
Date:
Subject: Re: Core team statement on replication in PostgreSQL