Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CDF17634A71 for ; Thu, 30 Jul 2009 11:19:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87567-01 for ; Thu, 30 Jul 2009 14:19:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mail.postgresql.org (Postfix) with ESMTP id 107E36344DE for ; Thu, 30 Jul 2009 11:19:33 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MWWTe-0004HN-8S for pgsql-sql@postgresql.org; Thu, 30 Jul 2009 14:19:26 +0000 Received: from e177123168.adsl.alicedsl.de ([85.177.123.168]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Jul 2009 14:19:26 +0000 Received: from tim by e177123168.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Jul 2009 14:19:26 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Tim Landscheidt Subject: Re: Tweak sql result set... ? Date: Thu, 30 Jul 2009 14:19:08 +0000 Organization: Lines: 30 Message-ID: References: <2981e447-3f11-4002-92fb-06a6af39762e@c29g2000yqd.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e177123168.adsl.alicedsl.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:4ZVAe5yJD7XdwRXRRalcnBhYm/A= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.158 tagged_above=-10 required=5 tests=AWL=0.158 X-Spam-Level: X-Archive-Number: 200907/151 X-Sequence-Number: 32892 (anonymous) wrote: >> > Any ideas on how to achieve this? I would like to let the original sql >> > code stay original. I can prepare postgres before executing the sql if >> > this makes it easier to acheive the goal >> Have a look at CREATE RULE. > Ok, you mean I could create a rule for the table, then I let the > script go into my "black box", > do the original selects, but get a manipulated result set back, then I > drop the rule so > that the blackbox of scripts can get the not manipulated result set > back? No, I meant that you should have a look at CREATE RULE. From a design perspective, I'd probably rename the old table and put an updatable view in its place. > I need to sometimes get the result "
output from query
" and > sometimes not > and it would be awesomw to get it with the same query, but maybe by > setting > a rule or similar. Best from performance view would be to make > something > more permanent. Is it possible to activate/deactivate a rule? Of course, DROP RULE. Tim