Re: views with parameters - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: views with parameters
Date
Msg-id 20041127210003.GA31115@wolff.to
Whole thread Raw
In response to views with parameters  ("Thomas Hermann(Software)" <hth@sprintsoft.de>)
List pgsql-novice
On Sat, Nov 27, 2004 at 21:07:03 +0100,
  "Thomas Hermann(Software)" <hth@sprintsoft.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.

pgsql-novice by date:

Previous
From: Michael Guerin
Date:
Subject: Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"
Next
From: Tom Lane
Date:
Subject: Re: ERROR: duplicate key violates unique constraint "pg_type_typname_nsp_index"