Tue, 29 Jan 2013 20:41:58 -0800 (PST)
 29 Jan 2013 20:41:58 -0800 (PST)
X-Newsgroups: pgsql.general
Date: Tue, 29 Jan 2013 20:41:57 -0800 (PST)
In-Reply-To: <[email protected]>
Complaints-To: [email protected]
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.167.116.131;
 posting-account=96NFGAoAAABqgpEyKCN3YH2nEalcbJuu
References: <[email protected]>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <[email protected]>
Subject: Re: Returning a range of array values?
From: Nick <[email protected]>
Injection-Date: Wed, 30 Jan 2013 04:41:58 +0000
Content-Type: text/plain; charset=ISO-8859-1
To: [email protected]

I just made one myself. Here it is in case any anyone else needs it...

CREATE FUNCTION array_range(array_var anyarray, start_var integer, end_var 
integer) RETURNS anyarray
    LANGUAGE sql IMMUTABLE STRICT
    AS $$SELECT ARRAY(SELECT array_var[gs] FROM 
generate_series(start_var,end_var) gs)::ANYARRAY$$;


-- 
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to