Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 68FEE63351A for ; Fri, 12 Mar 2010 02:56:51 -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 85030-07 for ; Fri, 12 Mar 2010 06:56:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by mail.postgresql.org (Postfix) with ESMTP id C9C48633327 for ; Fri, 12 Mar 2010 02:56:40 -0400 (AST) Received: by bwz28 with SMTP id 28so776936bwz.34 for ; Thu, 11 Mar 2010 22:56:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.33.131 with SMTP id h3mr3219389bkd.53.1268376999308; Thu, 11 Mar 2010 22:56:39 -0800 (PST) In-Reply-To: References: From: Jaime Casanova Date: Fri, 12 Mar 2010 01:56:24 -0500 Message-ID: <3073cc9b1003112256u4e3bfbb6q30c90fbd05d0fac6@mail.gmail.com> Subject: Re: Trigger on select :-( To: Ray Madigan Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/64 X-Sequence-Number: 33771 On Mon, Mar 1, 2010 at 9:10 PM, Ray Madigan wrote: > > What I want to do is when I do a SELECT on the Catalog and deliver the > result to the user, I want to check to see if the FooKey is in the users > ToDo table and set the value of a column isToDo to true or false dependin= g > on if the FooKey exists in the ToDo table for the user. you should do this when inserting data (with triggers of course) you can't use rules because a RULE ON SELECT you only can use one SELECT, no INSERT, UPDATE nor DELETE --=20 Atentamente, Jaime Casanova Soporte y capacitaci=C3=B3n de PostgreSQL Asesor=C3=ADa y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157