Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X4BuE-0001qN-TG for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jul 2014 16:36:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X4BuE-00033B-Ax for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jul 2014 16:36:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X4BuC-00030S-Mz for pgsql-bugs@postgresql.org; Mon, 07 Jul 2014 16:36:40 +0000 Received: from mail-we0-f172.google.com ([74.125.82.172]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X4Bu9-0006MA-9N for pgsql-bugs@postgresql.org; Mon, 07 Jul 2014 16:36:38 +0000 Received: by mail-we0-f172.google.com with SMTP id u57so4740758wes.31 for ; Mon, 07 Jul 2014 09:36:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=gMLTnM4ODrqVwwsB75XJNYXT3De6eO0tUoLphinS6VM=; b=ixiMFCZriJxhRhUKQmsN88miiHIfD6YshqXjZrxvBIu0L+WiC13Co0RBIWbhyezdkz UeEsaAgCSpwzceSaDVh7zkpX10ffGI0JbE2azFp0M4QfwKebMQwAWeuLhZo8HZ/LiN1e ISsbKDfW0qC0Wp4RNvDiksjs2IBvfGJPOd+OALNe21FGVbovUm4qc6o5lk7PHN35Mpuy AMvrqvPhKDns57b0TDLgmYc/0qcpFO79A8bTWWxCwHjpJAEvkIulRgC6mAnT2jXV4UiZ OYx4MCJNrgy+iky+sECm6/CIv7J5jayZIjBRbsgiwrnO4wDhafaWWv3h+Bdtm2RSqUMJ 0VPw== X-Gm-Message-State: ALoCoQmdCMe2lTD3Zj8pGjCZS54BTxtK1OwaU3BNeMwzi6o1miD1Depk2tyue/IT+tiLxGgz9vla X-Received: by 10.180.24.66 with SMTP id s2mr75478175wif.33.1404750994113; Mon, 07 Jul 2014 09:36:34 -0700 (PDT) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by mx.google.com with ESMTPSA id lq17sm16066774wic.19.2014.07.07.09.36.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Jul 2014 09:36:33 -0700 (PDT) Message-ID: <53BACC90.3080609@joh.to> Date: Mon, 07 Jul 2014 18:36:32 +0200 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: David G Johnston , pgsql-bugs@postgresql.org Subject: Re: BUG #10889: Cannot add 2 floats from regular expression References: <20140707135824.2752.47779@wrigleys.postgresql.org> <1404746726037-5810751.post@n5.nabble.com> In-Reply-To: <1404746726037-5810751.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 7/7/14 5:25 PM, David G Johnston wrote: > SELECT > (SELECT (regexp_matches('1.3', '([0-9\.]*)'))[1])::float > + > (SELECT (regexp_matches('2.3', '([0-9\.]*)'))[1])::float > ; > > Suggest wrapping it in a function - or making a "regexp_matches_single" > function that behaves similarly but returns a single text[] instead of a > SETOF text[] In this case, it would be easier to use substring(string from pattern). .marko -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs