Wednesday, June 4, 2008

Re: [HACKERS] Proposal: new function array_init

"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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: