pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tambet Matiisen <t.matiisen@aprote.ee>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Parameterized views proposition
Date: Wed, 16 Mar 2005 17:13:22 +0200
Message-ID: <A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com> (raw)


 
> 
> "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



view thread (9+ messages)

Message-ID: <A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com>
Permalink:  ../A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com/
Also on:    postgresql.org/message-id/A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: t.matiisen@aprote.ee, tgl@sss.pgh.pa.us
  Subject: Re: Parameterized views proposition
  In-Reply-To: <A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com>
  References: <A66A11DBF5525341AEF6B8DE39CDE770088059@black.aprote.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox