Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A8EA56F3528 for ; Mon, 7 Nov 2011 16:20:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 12367-02-7 for ; Mon, 7 Nov 2011 20:20:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-vx0-f174.google.com (mail-vx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id 2083C85C5B5 for ; Mon, 7 Nov 2011 16:13:51 -0400 (AST) Received: by vcbf1 with SMTP id f1so2457752vcb.19 for ; Mon, 07 Nov 2011 12:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=KZTjd/CyGrO9xejfX9oB5xqWdK24g4Kn/RlU0v2fMPI=; b=aN44D1Vyg//0rmx34zCK55gaHxwdi5ssfhWH6tCgrUWkTU/JGG7KJBRAaU6t3jGPZ/ 1/g0hqB+UyxYst00CGXm97u/t4GyVJmmzXLZ3WM0JluE7oPmcoEVcc62qyoXL1ia6nJg xHrevlWv4ZckcYaHmIeLeP9QYjrTFXplbn5i0= Received: by 10.52.37.10 with SMTP id u10mr28136993vdj.57.1320696830470; Mon, 07 Nov 2011 12:13:50 -0800 (PST) Received: from jay.local (c-24-63-250-125.hsd1.ma.comcast.net. [24.63.250.125]) by mx.google.com with ESMTPS id dw3sm31652097vdb.16.2011.11.07.12.13.46 (version=SSLv3 cipher=OTHER); Mon, 07 Nov 2011 12:13:49 -0800 (PST) Message-ID: <4EB83BF7.4070905@gmail.com> Date: Mon, 07 Nov 2011 15:13:43 -0500 From: Jay Levitt User-Agent: Postbox 3.0.1 (Macintosh/20111102) MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Predicates not getting pushed into SQL function? References: <4EB2D3CB.7020708@gmail.com> <6646.1320345676@sss.pgh.pa.us> <4EB2E251.90906@gmail.com> <11061.1320352516@sss.pgh.pa.us> In-Reply-To: <11061.1320352516@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201111/96 X-Sequence-Number: 45607 Tom Lane wrote: > Please don't send HTML-only email to these lists. Oops - new mail client, sorry. > Anyway, the answer seems to be that inline_set_returning_function needs > some work to handle cases with declared OUT parameters. I will see > about fixing that going forward, but in existing releases what you need > to do is declare the function as returning SETOF some named composite > type Yes, that patch works great! Oddly enough, the workaround now does NOT work; functions returning SETOF named composite types don't get inlined, but functions returning the equivalent TABLE do get inlined. Let me know if you need a failcase, but the bug doesn't actually affect me now :) Jay > > create type matcher_result as (user_id int, match int); > > create or replace function matcher() returns setof matcher_result as ...