X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B0EBE476406 for ; Wed, 30 Apr 2003 00:00:50 -0400 (EDT) Received: from lms2.clarkson.edu (lms2.clarkson.edu [128.153.3.131]) by postgresql.org (Postfix) with ESMTP id 840DD4763A4 for ; Wed, 30 Apr 2003 00:00:47 -0400 (EDT) Received: from qms2.clarkson.edu ([128.153.3.131]) by lms2.clarkson.edu (Lotus Domino Release 6.0.1CF1) with SMTP id 2003043000005154-34379 ; Wed, 30 Apr 2003 00:00:51 -0400 Received: (qmail 884948 invoked from network); 30 Apr 2003 04:00:51 -0000 Received: from tibook.brooks.clarkson.edu (HELO clarkson.edu) (128.153.151.185) by mail.clarkson.edu with SMTP; 30 Apr 2003 04:00:51 -0000 Date: Wed, 30 Apr 2003 00:00:51 -0400 Subject: rules question Mime-Version: 1.0 (Apple Message framework v552) Cc: pgsql-sql@postgresql.org To: pgsql-general@postgresql.org From: ed despard Message-Id: <55369696-7AC0-11D7-B730-0003938ABE54@clarkson.edu> X-Mailer: Apple Mail (2.552) X-MIMETrack: Itemize by SMTP Server on lms2/Clarkson(Release 6.0.1CF1|March 04, 2003) at 04/30/2003 00:00:51, Serialize by Router on lms2/Clarkson(Release 6.0.1CF1|March 04, 2003) at 04/30/2003 00:00:52, Serialize complete at 04/30/2003 00:00:52 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, hits=-8.9 required=5.0 tests=BAYES_10,USER_AGENT_APPLEMAIL version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/1548 X-Sequence-Number: 41613 hi, i have a table named pursuit which has no data in it, currently to get data for the table i have a function that i call like: select * from pursuit_select_function(raceid), but i put in the raceid that im selecting for. i would like to be able to treat this table like a view and make a query like select * from pursuit where raceid=9 or somthing and have a rule rewrite this into the function call. is there a way to have a rule that rewrites the query based on the qualifier of the query? the reason im not just using a normal view is that i have a sequence that needs to be reset before each select, so the pursuit_select_function resets the sequence and does the select query. thanks. ed