Re: views with parameters

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Thomas Hermann(Software)" <hth(at)sprintsoft(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: views with parameters
Date: 2004-11-27 21:00:03
Message-ID: 20041127210003.GA31115@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, Nov 27, 2004 at 21:07:03 +0100,
"Thomas Hermann(Software)" <hth(at)sprintsoft(dot)de> wrote:
>
> Much to my dismay the documentation does not specify any
> parameters/arguments which can be used with views. But views do retun a
> complete record or record sets as defined in pg.

That doesn't make much sense. Views look like tables. Tables don't
have arguments or parameters. If you want a subset of the records
defined by a view, you can use the where clause.

> One can send arguments with functions, but by whatever reason (and return
> type), i have not been able to get anything back which compares to what
> comes back from an ordinary select oder view. Best i got: a colon separated
> string having all the data in one field (although a special type was
> referenced etc.)

Recent versions from Postgres allow set returning functions. You can use these
in the from item list. I don't use these, but my memory is that there have
been some significant improvements for version 8.0, so you might want to
look at the 8.0 beta for your initial development. 8.0 will probably be
released in a month.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-11-27 21:44:48 Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"
Previous Message Michael Guerin 2004-11-27 20:25:37 Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"