Re: [SQL] kind of RULE on SELECT depending on existence of a WHERE condition

2010-03-02 Thread rawi
Richard Huxton wrote: > > You could write a set-returning function that takes either: > 1. A list of conditions > 2. The text for a WHERE clause > If it gets no conditions or a blank string, it returns nothing. > You will need to create the function with SECURITY DEFINER permissions, > That's

Re: [SQL] kind of RULE on SELECT depending on existence of a WHERE condition

2010-03-02 Thread Craig Ringer
On 1/03/2010 9:38 PM, Richard Huxton wrote: On 01/03/10 12:16, rawi wrote: Not quite the way you suggest. You could build a series of views with the WHERE conditions built in to them, and grant permissions on those though. Thank you very much for your help. Unfortunately is this not what I

[SQL] determine the curval() of a view

2010-03-02 Thread John
Hi, I am working with a view that has a "_INSERT" rule. I'm wondering if there is a way to determine what the curval() of the PK (serial type) after an insert occurs. Given the name of the view I'd like to determine the sequence associated with the view's PK. Actually, I wonder if it is ev