rules question - Mailing list pgsql-general

From ed despard
Subject rules question
Date
Msg-id 55369696-7AC0-11D7-B730-0003938ABE54@clarkson.edu
Whole thread Raw
Responses Re: rules question  (Richard Huxton <dev@archonet.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: dump/restore to 7.4devel giving "[archiver (db)] error returned by PQputline"
Next
From: Martijn van Oosterhout
Date:
Subject: Re: qsort (was Re: Solaris)