Re: Passing arguments to views

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Chris Campbell <chris(at)bignerdranch(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Passing arguments to views
Date: 2006-02-03 07:09:10
Message-ID: 43E30196.7040603@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tino Wildenhain 2006-02-03 07:16:46 Re: Multiple logical databases
Previous Message Peter Eisentraut 2006-02-03 06:26:24 Re: Where to execute the compiled psql