Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 94F86632D69 for ; Wed, 2 Sep 2009 07:58:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10660-09 for ; Wed, 2 Sep 2009 10:58:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f216.google.com (mail-ew0-f216.google.com [209.85.219.216]) by mail.postgresql.org (Postfix) with ESMTP id B4043632CA2 for ; Wed, 2 Sep 2009 07:58:16 -0300 (ADT) Received: by ewy12 with SMTP id 12so625395ewy.24 for ; Wed, 02 Sep 2009 03:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=NbAcZ3uacPs608H8VmZveg8Tl8Uaxd1HXbpFo9trr9U=; b=fOjyamzcISNEqI6bQLGvSerfwqTExh+XYRl63WH1H4YlcWPJDZrm53mgNvqQ/dr1Pn 3mtQqXkurkpTvZ5iXGliAuRLAuDm/cJzgxUy0TSHZlZSXpg/04orqFhr+hJL0VvYgLFv bOyPX6vfq+1bnLIKRW5UqxzHTgZhJvUqbSbOc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=DLs9wOPSew3p+5or3kez5WhikAgFZP70Mm24U+M7NwHYITguaZr5Ul+3g76B+/Ei/B MZeVhrnAkDmPnoLiP2mZFPEJ6N9jmhddEzcIhECjZH127jiRifh4JNgqAp2cWyFw18oQ x8WkW1iVB+st/6CFKexD57m6RbAjfM6y3ryYM= Received: by 10.216.48.195 with SMTP id v45mr113169web.123.1251889094572; Wed, 02 Sep 2009 03:58:14 -0700 (PDT) Received: from ?192.168.1.128? (net-93-144-255-254.t2.dsl.vodafone.it [93.144.255.254]) by mx.google.com with ESMTPS id m5sm2512791gve.3.2009.09.02.03.58.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Sep 2009 03:58:12 -0700 (PDT) Message-ID: <4A9E4FC0.1010908@gmail.com> Date: Wed, 02 Sep 2009 12:58:08 +0200 From: Gianvito Pio User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Min and max element of an array column Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200909/12 X-Sequence-Number: 33077 Hello, is it possible to obtain the minimum and the maximum single element of an array column? Example: [1, 2 ,5] [3, -1, 6] [9, 18,-4 ] I'd just like to make a query that gives me the min (-4) and the max(18) of the column. Is that possible without a function? Thanks