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

From Tom Lane
Subject Re: Proposal: new function array_init
Date
Msg-id 6506.1212619137@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: new function array_init  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: Proposal: new function array_init  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-hackers
"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.

> 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


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Overhauling GUCS
Next
From: Rainer Bauer
Date:
Subject: Re: Overhauling GUCS