Re: "writable CTEs"

From: David Fetter <david(at)fetter(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: "writable CTEs"
Date: 2010-12-28 17:31:05
Message-ID: 20101228173105.GH25421@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 28, 2010 at 04:35:26PM +0200, Peter Eisentraut wrote:
> On tis, 2010-12-28 at 00:19 +0000, Peter Geoghegan wrote:
> > It's worth noting that officially (i.e. in the docs), we don't even
> > call CTEs CTEs at any point. We call them WITH queries. I think that
> > that's a mistake because we call them CTEs everywhere else.
>
> I think "WITH query" or "WITH clause" is more understandable than CTE,
> which to me is a term that has no relationship with anything else.

Common Table Expression, or CTE for short, is the standard
terminology, and I don't just mean SQL:2008. It's standard in DB2,
Drizzle, Firebird, HSQLDB, Informix, Microsoft SQL Server, Oracle, and
Sybase SQL Anywhere, at a minimum.

"WITH query" is a pure PostgreSQL invention, and not a super helpful
one to the vast majority of users. Please bear in mind that if this
is to remain a successful project, the vast majority of users are
*future* users, not current or past ones. We don't talk about
"Subquery queries" or "FULL JOIN queries" and give them their own doc
section, nor should we. We should instead refactor the docs to point
to CTEs in the appropriate places, and it's my hope that those places
will increase over time.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-12-28 17:33:06 Re: pg_dump --split patch
Previous Message Andrew Dunstan 2010-12-28 17:17:22 Re: pg_dump --split patch