On 28 December 2010 12:09, Robert Haas <robertmh...@gmail.com> wrote:
> On Tue, Dec 28, 2010 at 12:45 AM, David Fetter <da...@fetter.org> wrote:
>> I don't see how people can be relying on links to 9.1-to-be's
>> documentation.
>
> Well, it's always handy when the filenames are the same across
> versions.  Ever looked at the 9.0 documentation for something and then
> modified the URL to see what it looked like in 8.1 or something?

I do this all the time. Anyway, I intend for this doc patch to be
backported to 8.4 as a bugfix, which is part of the reason why it
isn't invasive - it's just a clarification. Clearly if it makes sense
for 9.1, it makes just as much sense for 9.0 and 8.4.

> No, actually I think Peter has it right.  A query with one or more
> common table expressions is a WITH-query.  This is a subtle difference
> but could affect the way that things are phrased in the documentation.

Attached is a new patch written with this consideration in mind. It
also has an acronym.sgml entry for CTE, which was absent from my
earlier patch. I think David actually agreed that I was right to have
doubts.

-- 
Regards,
Peter Geoghegan
diff --git a/doc/src/sgml/acronyms.sgml b/doc/src/sgml/acronyms.sgml
index 23ab3b4..5dad0db 100644
--- a/doc/src/sgml/acronyms.sgml
+++ b/doc/src/sgml/acronyms.sgml
@@ -99,6 +99,15 @@
    </varlistentry>
 
    <varlistentry>
+    <term><acronym>CTE</acronym></term>
+    <listitem>
+     <para>
+      <link linkend="queries-with">Common Table Expression</link>
+     </para>
+    </listitem>
+   </varlistentry>
+
+   <varlistentry>
     <term><acronym>CVE</acronym></term>
     <listitem>
      <para>
diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml
index f6e081e..97e3977 100644
--- a/doc/src/sgml/queries.sgml
+++ b/doc/src/sgml/queries.sgml
@@ -1525,7 +1525,7 @@ SELECT <replaceable>select_list</replaceable> FROM <replaceable>table_expression
 
 
  <sect1 id="queries-with">
-  <title><literal>WITH</literal> Queries</title>
+  <title><literal>WITH</literal> Queries (Common Table Expressions)</title>
 
   <indexterm zone="queries-with">
    <primary>WITH</primary>
@@ -1539,7 +1539,8 @@ SELECT <replaceable>select_list</replaceable> FROM <replaceable>table_expression
 
   <para>
    <literal>WITH</> provides a way to write subqueries for use in a larger
-   query.  The subqueries can be thought of as defining
+   query.  The subqueries, which are often referred to as Common table
+   expressions or <acronym>CTE</acronym>s, can be thought of as defining
    temporary tables that exist just for this query.  One use of this feature
    is to break down complicated queries into simpler parts.  An example is:
 
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to