Re: Parameterized views proposition - Mailing list pgsql-sql

From Tambet Matiisen
Subject Re: Parameterized views proposition
Date
Msg-id A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com
Whole thread Raw
In response to Parameterized views proposition  ("Tambet Matiisen" <t.matiisen@aprote.ee>)
List pgsql-sql
>
> "Tambet Matiisen" <t.matiisen@aprote.ee> writes:
> > How tough it would be to implement
>
> > CREATE VIEW xxx PARAMETERS (yyy) AS zzz;
>
> > as
>
> > CREATE TYPE xxx;
> > CREATE FUNCTION xxx(yyy) RETURNING SETOF xxx LANGUAGE sql AS 'zzz';
>
> What's the point?  It'd be nonstandard anyway, so just use
> the function.
>
>             regards, tom lane
>

1. Cleaner syntax.
2. No possible inconsistencies between return type and query result.
3. No strange quoting, like '' and $$.
4. Just to save some keystrokes.

Another issue, that has to be handled separately:
5. Show up in EXPLAIN as normal query, not function scan.

About standards - maybe it's time to set some standard? :) Now
seriously, maybe it's really not right to call it a parameterized view.
Maybe instead CREATE FUNCTION syntax could be improved somehow, so that
you don't have to CREATE TYPE separately.
 Tambet


pgsql-sql by date:

Previous
From: "Tambet Matiisen"
Date:
Subject: Re: How to force subquery scan?
Next
From: Tom Lane
Date:
Subject: Re: How to force subquery scan?