Re: Parameterized views proposition

From: "Tambet Matiisen" <t(dot)matiisen(at)aprote(dot)ee>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Parameterized views proposition
Date: 2005-03-16 15:13:22
Message-ID: A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql



>
> "Tambet Matiisen" <t(dot)matiisen(at)aprote(dot)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

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-03-16 15:41:52 Re: How to force subquery scan?
Previous Message Tambet Matiisen 2005-03-16 14:52:50 Re: How to force subquery scan?