Received: from mail.enterprise.net (root@mail.enterprise.net [194.72.192.18]) by hub.org (8.9.2/8.9.1) with ESMTP id GAA84722; Fri, 29 Jan 1999 06:02:10 -0500 (EST) (envelope-from olly@lfix.co.uk) Received: from linda.lfix.co.uk (root@ppp169.enterprise.net [194.72.195.169]) by mail.enterprise.net (8.8.5/8.8.5) with ESMTP id LAA12456; Fri, 29 Jan 1999 11:02:07 GMT Received: from linda.lfix.co.uk (olly@localhost [127.0.0.1]) by linda.lfix.co.uk (8.9.2/8.9.1/Debian/GNU) with ESMTP id LAA06515; Fri, 29 Jan 1999 11:01:54 GMT Message-Id: <199901291101.LAA06515@linda.lfix.co.uk> X-Mailer: exmh version 2.0.2 2/24/98 (debian) X-URL: http://www.lfix.co.uk/oliver X-face: "xUFVDj+ZJtL_IbURmI}!~xAyPC"Mrk=MkAm&tPQnNq(FWxv49R}\>0oI8VM?O2VY+N7@F- KMLl*!h}B)u@TW|B}6 This patch is to expand the reference documentation for COPY and SELECT: *** postgresql-6.4.2.orig/doc/src/sgml/ref/copy.sgml Thu Jan 28 16:11:12 1999 --- postgresql-6.4.2/doc/src/sgml/ref/copy.sgml Thu Jan 28 16:10:22 1999 *************** *** 390,396 **** ! Bugs COPY stops operation at the first error. This should not lead to problems in the event of --- 390,400 ---- ! Bugs and features ! ! COPY neither invokes rules nor acts on column defaults. ! It does invoke triggers, however. ! COPY stops operation at the first error. This should not lead to problems in the event of *** postgresql-6.4.2.orig/doc/src/sgml/ref/select.sgml Thu Jan 28 16:11:12 1999 --- postgresql-6.4.2/doc/src/sgml/ref/select.sgml Thu Jan 28 16:16:35 1999 *************** *** 190,198 **** Description ! SELECT will get all rows which satisfy the ! WHERE condition ! or all rows of a table if WHERE is omitted. The GROUP BY clause allows a user to divide a table --- 190,204 ---- Description ! SELECT will return rows from one or more tables. ! Candidates for selection are rows which satisfy the WHERE condition; ! if WHERE is omitted, all rows are candidates. ! ! DISTINCT will eliminate all duplicate rows from the ! selection. ! DISTINCT ON column will eliminate all duplicates in the specified column; this is ! equivalent to using GROUP BY column. ALL will return all candidate rows, ! including duplicates. The GROUP BY clause allows a user to divide a table *************** *** 232,239 **** where cond_op can be ! one of: =, <, <=, >, >=, <> ! or a conditional operator like ALL, ANY, IN, LIKE, et cetera and log_op can be one of: AND, OR, NOT. The comparison returns either TRUE or FALSE and all --- 238,246 ---- where cond_op can be ! one of: =, <, <=, >, >= or <>, ! a conditional operator like ALL, ANY, IN, LIKE, et cetera or a ! locally-defined operator, and log_op can be one of: AND, OR, NOT. The comparison returns either TRUE or FALSE and all *************** *** 251,260 **** GROUP BY specifies a grouped table derived by the application ! of the this clause: GROUP BY column [, ...] ! --- 258,273 ---- GROUP BY specifies a grouped table derived by the application ! of this clause: GROUP BY column [, ...] ! ! ! GROUP BY will condense into a single row all rows that share the same values for the ! grouped columns; aggregates return values derived from all rows that make up the group. The value returned for an ungrouped ! and unaggregated column is dependent on the order in which rows happen to be read from the database. ! ! *************** *** 312,319 **** ! The columns in the ORDER BY must appear in the SELECT clause. ! Thus the following statement is illegal: SELECT name FROM distributors ORDER BY code; --- 325,332 ---- ! From release 6.4 of PostgreSQL, the columns in the ORDER BY clause do not need to appear in the SELECT clause. ! Thus the following statement is now legal: SELECT name FROM distributors ORDER BY code; *************** *** 394,400 **** To sum the column len of all films and group ! the reults by kind: SELECT kind, SUM(len) AS total FROM films GROUP BY kind; --- 407,413 ---- To sum the column len of all films and group ! the results by kind: SELECT kind, SUM(len) AS total FROM films GROUP BY kind; *************** *** 410,416 **** To sum the column len of all films, group ! the reults by kind and show those group totals that are less than 5 hours: --- 423,429 ---- To sum the column len of all films, group ! the results by kind and show those group totals that are less than 5 hours: *************** *** 525,530 **** --- 538,547 ---- "AS" clause may be referenced in GROUP BY and HAVING clauses. This is not currently allowed in Postgres. + + + + The DISTINCT ON phrase is not part of SQL92. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID 32B8FAA1 ======================================== "My son, if sinners entice thee, consent thou not." Proverbs 1:10