Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7D4C4632FF7 for ; Tue, 2 Mar 2010 05:43:35 -0400 (AST) 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 53513-01 for ; Tue, 2 Mar 2010 09:43:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 1A825632245 for ; Tue, 2 Mar 2010 05:43:25 -0400 (AST) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NmOdP-0008BM-RG for pgsql-sql@postgresql.org; Tue, 02 Mar 2010 01:43:23 -0800 Message-ID: <27753818.post@talk.nabble.com> Date: Tue, 2 Mar 2010 01:43:23 -0800 (PST) From: rawi To: pgsql-sql@postgresql.org Subject: Re: kind of RULE on SELECT depending on existence of a WHERE condition In-Reply-To: <4B8BC36E.4040007@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: only4com@web.de References: <27741669.post@talk.nabble.com> <4B8B983B.4080205@archonet.com> <27742718.post@talk.nabble.com> <4B8BC36E.4040007@archonet.com> 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: 201003/9 X-Sequence-Number: 33716 Richard Huxton wrote: > > You could write a set-returning function that takes either: > 1. A list of conditions > 2. The text for a WHERE clause > If it gets no conditions or a blank string, it returns nothing. > You will need to create the function with SECURITY DEFINER permissions, > That's a very good suggestion. I've just red about SECURITY DEFINER... great. Thanks -- View this message in context: http://old.nabble.com/kind-of-RULE-on-SELECT-depending-on-existence-of-a-WHERE-condition-tp27741669p27753818.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.