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: <c2fa0694-e9f2-4663-b186-0e804995b2d8@xxxxxxxxxxxxxxxx> Complaints-To: groups-abuse@xxxxxxxxxx Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.167.116.131; posting-account=96NFGAoAAABqgpEyKCN3YH2nEalcbJuu References: <c2fa0694-e9f2-4663-b186-0e804995b2d8@xxxxxxxxxxxxxxxx> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <e33dcbf7-34fb-4209-8544-f6708173825d@xxxxxxxxxxxxxxxx> Subject: Re: Returning a range of array values? From: Nick <nboutelier@xxxxxxxxx> Injection-Date: Wed, 30 Jan 2013 04:41:58 +0000 Content-Type: text/plain; charset=ISO-8859-1 To: pgsql-general@xxxxxxxxxxxxxx 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 (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general