Re: Passing arguments to views - Mailing list pgsql-hackers

From Tino Wildenhain
Subject Re: Passing arguments to views
Date
Msg-id 43E30196.7040603@wildenhain.de
Whole thread Raw
In response to Re: Passing arguments to views  (Chris Campbell <chris@bignerdranch.com>)
Responses Re: Passing arguments to views
List pgsql-hackers
Chris Campbell schrieb:
...
> That was a very simplistic example and didn't illustrate my point --  I
> apologize. I was trying to think of something succinct and  illustrative
> for a quick mailing list post but came up short.
> 
> Maybe a better example would be a situation where you want to do 
> substitutions in places other than the WHERE clause? There's no way  to
> "push" that out to the calling query. But even in this simple  case, the
> easier-to-grok syntax of making a view look like a function  (and
> codifying the options for restricting the results as arguments  to the
> view) is a nice win in terms of readability and maintainability.

Well if the view does not suit your needs, why dont you use an
set returnung function instead? Inside it you can do all the magic
you want and still use it similar to a table or view.

Regards
Tino


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Where to execute the compiled psql
Next
From: Tino Wildenhain
Date:
Subject: Re: Multiple logical databases