Re: Looping through string constants

From: Scott Bailey <artacus(at)comcast(dot)net>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looping through string constants
Date: 2009-08-13 15:30:07
Message-ID: 4A84317F.5010709@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Wed, Aug 12, 2009 at 08:45:58PM -0700, Scott Bailey wrote:
>> CREATE OR REPLACE FUNCTION unnest(anyarray)
>> RETURNS SETOF anyelement AS
>> $BODY$
>> SELECT $1[i] FROM
>> generate_series(array_lower($1,1),
>> array_upper($1,1)) i;
>> $BODY$
>> LANGUAGE 'sql' IMMUTABLE STRICT
>
> I'd recommend taking off the "STRICT" from this. It will, counter
> intuitively, slow things down when you're not expecting it.
>

Woah! Really? I use strict a lot when it doesn't make sense to process a
function with a null param. Can you give me more details or point me to
more reading on this issue? Thanks.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-08-13 15:43:11 Re: array syntax and geometric type syntax
Previous Message Scara Maccai 2009-08-13 15:25:43 Re: totally different plan when using partitions