Re: Proposal: new function array_init

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: Decibel! <decibel(at)decibel(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: new function array_init
Date: 2008-06-04 22:38:57
Message-ID: 6506.1212619137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rainer Bauer 2008-06-04 23:23:53 Re: Overhauling GUCS
Previous Message David E. Wheeler 2008-06-04 21:57:28 Re: Overhauling GUCS