Re: Looping through string constants

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Looping through string constants
Date: 2009-08-13 10:33:38
Message-ID: 20090813103338.GA5407@samason.me.uk
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.

--
Sam http://samason.me.uk/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2009-08-13 10:51:49 multiple paramters in aggregate function
Previous Message Richard Huxton 2009-08-13 09:22:24 Re: totally different plan when using partitions