X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6C106D1B18F for ; Fri, 4 Jun 2004 01:34:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07673-01 for ; Fri, 4 Jun 2004 04:34:47 +0000 (GMT) Received: from mygeotivity.com (unknown [204.191.12.226]) by svr1.postgresql.org (Postfix) with SMTP id 845E4D1B1DF for ; Fri, 4 Jun 2004 01:34:44 -0300 (ADT) Received: (qmail 8930 invoked by uid 0); 4 Jun 2004 04:33:42 -0000 Received: from unknown (HELO scada01) (cdedels@204.191.12.225) by 204.191.12.226 with SMTP; 4 Jun 2004 04:33:42 -0000 From: "Christopher Dedels" To: Subject: dynamic rules? Date: Thu, 3 Jun 2004 21:32:47 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 thread-index: AcRJ7PzuVMViA77+R6uSpgb0wM7L9Q== Message-Id: <20040604043444.845E4D1B1DF@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200406/33 X-Sequence-Number: 17978 Is it possible to create a select rule that returns results depending on a where clause in the original select statement? For Example (oversimplified): CREATE TABLE one (data int); CREATE TABLE two (data int); I make the query: SELECT data FROM number WHERE type=1; If the type is 1 (type=1) I want to return 'SELECT data FROM one;' If the type is 2 (type=2) I want to return 'SELECT data FROM two;' Thanks, Chris