Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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.


In response to


pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group