Re: Proposal: new function array_init

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-05 03:59:27
Message-ID: 162867790806042059t3f6afdbci871fab3d459588d1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/6/5 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "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.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Koichi Suzuki 2008-06-05 04:21:25 Re: Core team statement on replication in PostgreSQL
Previous Message Greg Smith 2008-06-05 03:43:25 Re: Overhauling GUCS