X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id BDF97CCFDC for ; Sat, 19 Jul 2003 23:11:01 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 44351-04 for ; Sat, 19 Jul 2003 23:11:33 +0000 (GMT) Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by svr1.postgresql.org (Postfix) with ESMTP id 748E9CCFCD for ; Sat, 19 Jul 2003 20:10:59 -0300 (ADT) Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) by sabre.velocet.net (Postfix) with ESMTP id 1D96913BB52; Sat, 19 Jul 2003 19:11:32 -0400 (EDT) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 19e0rT-0002oF-00; Sat, 19 Jul 2003 19:11:31 -0400 To: Joe Conway Cc: miker@n2bb.com, pgsql-sql@postgresql.org Subject: Re: casting to arrays References: <200307181707.48441.miker@n2bb.com> <3F1867F3.7000109@joeconway.com> In-Reply-To: <3F1867F3.7000109@joeconway.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 19 Jul 2003 19:11:30 -0400 Message-ID: <87lluu2jtp.fsf@stark.dyndns.tv> Lines: 16 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/267 X-Sequence-Number: 14381 Joe Conway writes: > Not possible in current releases, but it will be in 7.4 (about to start beta). > It looks like this: Well there is the int_array_aggregate function in the contrib/intagg directory. It has to be compiled separately, and it has a few quirks (like the arrays are zero-based instead of 1-based) but it works more or less, and it does exactly what you describe. But the 7.4 stuff should be much cleaner and more flexible, so if you don't need it right now you're better off waiting. -- greg