Commit Graph

113 Commits

Author SHA1 Message Date
Bruce Momjian 159e3d8629 Update contrib documention mentions to point to actual documentation
sections, rather than just calling it "/contrib/module_name".

Also update pg_test_fsync build instructions now that it is in /contrib.
2011-01-26 09:22:21 -05:00
Robert Haas 92f7eebbbd Document that WITH queries are also called Common Table Expressions.
Peter Geoghegan, reviewed by Stephen Frost
2011-01-19 21:19:53 -05:00
Tom Lane 07f1264dda Allow WITH clauses to be attached to INSERT, UPDATE, DELETE statements.
This is not the hoped-for facility of using INSERT/UPDATE/DELETE inside
a WITH, but rather the other way around.  It seems useful in its own
right anyway.

Note: catversion bumped because, although the contents of stored rules
might look compatible, there's actually a subtle semantic change.
A single Query containing a WITH and INSERT...VALUES now represents
writing the WITH before the INSERT, not before the VALUES.  While it's
not clear that that matters to anyone, it seems like a good idea to
have it cited in the git history for catversion.h.

Original patch by Marko Tiikkaja, with updating and cleanup by
Hitoshi Harada.
2010-10-15 19:55:25 -04:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Tom Lane e49ae8d3bc Recognize functional dependency on primary keys. This allows a table's
other columns to be referenced without listing them in GROUP BY, so long as
the primary key column(s) are listed in GROUP BY.

Eventually we should also allow functional dependency on a UNIQUE constraint
when the columns are marked NOT NULL, but that has to wait until NOT NULL
constraints are represented in pg_constraint, because we need to have
pg_constraint OIDs for all the conditions needed to ensure functional
dependency.

Peter Eisentraut, reviewed by Alex Hunsaker and Tom Lane
2010-08-07 02:44:09 +00:00
Robert Haas 276a8f4e99 Additional cross-references to window functions documentation.
Erik Rijkers
2010-07-03 02:57:46 +00:00
Peter Eisentraut 6dcce3985b Remove unnecessary xref endterm attributes and title ids
The endterm attribute is mainly useful when the toolchain does not support
automatic link target text generation for a particular situation.  In  the
past, this was required by the man page tools for all reference page links,
but that is no longer the case, and it now actually gets in the way of
proper automatic link text generation.  The only remaining use cases are
currently xrefs to refsects.
2010-04-03 07:23:02 +00:00
Tom Lane 289e2905c8 Remove add_missing_from GUC and associated parser support for "implicit RTEs".
Per recent discussion, add_missing_from has been deprecated for long enough to
consider removing, and it's getting in the way of planned parser refactoring.
The system now always behaves as though add_missing_from were OFF.
2009-10-21 20:22:38 +00:00
Tom Lane c30446b9c9 Proofreading for Bruce's recent round of documentation proofreading.
Most of those changes were good, but some not so good ...
2009-06-17 21:58:49 +00:00
Bruce Momjian ba36c48e39 Proofreading adjustments for first two parts of documentation (Tutorial
and SQL).
2009-04-27 16:27:36 +00:00
Bruce Momjian 053835d334 Document that LIMIT NULL is the same as no LIMIT clause. 2009-02-07 20:11:16 +00:00
Tom Lane 8e8854daa2 Add some basic support for window frame clauses to the window-functions
patch.  This includes the ability to force the frame to cover the whole
partition, and the ability to make the frame end exactly on the current row
rather than its last ORDER BY peer.  Supporting any more of the full SQL
frame-clause syntax will require nontrivial hacking on the window aggregate
code, so it'll have to wait for 8.5 or beyond.
2008-12-31 00:08:39 +00:00
Tom Lane 95b07bc7f5 Support window functions a la SQL:2008.
Hitoshi Harada, with some kibitzing from Heikki and Tom.
2008-12-28 18:54:01 +00:00
Tom Lane 06224652f2 Add docs and regression test about sorting the output of a recursive query in
depth-first search order.  Upon close reading of SQL:2008, it seems that the
spec's SEARCH DEPTH FIRST and SEARCH BREADTH FIRST options do not actually
guarantee any particular result order: what they do is provide a constructed
column that the user can then sort on in the outer query.  So this is actually
just as much functionality ...
2008-10-14 00:41:35 +00:00
Tom Lane 1f238e569a Eliminate unnecessary array[] decoration in examples of recursive cycle
detection.
2008-10-14 00:12:44 +00:00
Tom Lane e3b0117459 Implement comparison of generic records (composite types), and invent a
pseudo-type record[] to represent arrays of possibly-anonymous composite
types.  Since composite datums carry their own type identification, no
extra knowledge is needed at the array level.

The main reason for doing this right now is that it is necessary to support
the general case of detection of cycles in recursive queries: if you need to
compare more than one column to detect a cycle, you need to compare a ROW()
to an array built from ROW()s, at least if you want to do it as the spec
suggests.  Add some documentation and regression tests concerning the cycle
detection issue.
2008-10-13 16:25:20 +00:00
Tom Lane 0d115dde82 Extend CTE patch to support recursive UNION (ie, without ALL). The
implementation uses an in-memory hash table, so it will poop out for very
large recursive results ... but the performance characteristics of a
sort-based implementation would be pretty unpleasant too.
2008-10-07 19:27:04 +00:00
Tom Lane 44d5be0e53 Implement SQL-standard WITH clauses, including WITH RECURSIVE.
There are some unimplemented aspects: recursive queries must use UNION ALL
(should allow UNION too), and we don't have SEARCH or CYCLE clauses.
These might or might not get done for 8.4, but even without them it's a
pretty useful feature.

There are also a couple of small loose ends and definitional quibbles,
which I'll send a memo about to pgsql-hackers shortly.  But let's land
the patch now so we can get on with other development.

Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane
2008-10-04 21:56:55 +00:00
Tom Lane e67867b26c Allow AS to be omitted when specifying an output column name in SELECT
(or RETURNING), but only when the output name is not any SQL keyword.
This seems as close as we can get to the standard's syntax without a
great deal of thrashing.  Original patch by Hiroshi Saito, amended by me.
2008-02-15 22:17:06 +00:00
Bruce Momjian 8b4ff8b6a1 Wording cleanup for error messages. Also change can't -> cannot.
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 19:10:30 +00:00
Bruce Momjian 09a9f10e7f Consistenly use colons before '<programlisting>' blocks, where
appropriate.
2007-02-01 00:28:19 +00:00
Bruce Momjian a134ee3379 Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".

Also update two error messages mentioned in the documenation to match.
2007-01-31 20:56:20 +00:00
Tom Lane 1e0bf9041e Marginal tweaks in the documentation for ORDER BY; in particular point
out the common error that ORDER BY x, y DESC does not mean the same as
ORDER BY x DESC, y DESC.
2007-01-09 16:59:20 +00:00
Tom Lane 4431758229 Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST
per-column options for btree indexes.  The planner's support for this is still
pretty rudimentary; it does not yet know how to plan mergejoins with
nondefault ordering options.  The documentation is pretty rudimentary, too.
I'll work on improving that stuff later.

Note incompatible change from prior behavior: ORDER BY ... USING will now be
rejected if the operator is not a less-than or greater-than member of some
btree opclass.  This prevents less-than-sane behavior if an operator that
doesn't actually define a proper sort ordering is selected.
2007-01-09 02:14:16 +00:00
Tom Lane cfb3a42831 Rewrite discussion of ORDER BY to emphasize the SQL99 expression case
instead of the SQL92 output-column-ID case.
2006-10-24 02:24:27 +00:00
Peter Eisentraut 0f763503ff Spellchecking and such 2006-10-23 18:10:32 +00:00
Tom Lane fa5d08fbf8 Some desultory copy-editing. 2006-10-22 03:03:41 +00:00
Tom Lane b5b1eb80b7 Documentation for VALUES lists. Joe Conway and Tom Lane 2006-09-18 19:54:01 +00:00
Neil Conway 8c5dfbabff Minor SGML style police work. 2006-02-18 23:14:45 +00:00
Bruce Momjian 545828a754 Documentation adjustments.
Vladimir Chukharev
2005-05-08 03:08:05 +00:00
Bruce Momjian 1ced129aa3 More < and > cleanups converted to ampersands. 2005-01-22 22:56:36 +00:00
Tom Lane f8ffb60492 A small pass of docs review and copy-editing. 2004-12-23 05:37:40 +00:00
Neil Conway ec7a6bd9a2 Replace "--" and "---" with "&mdash;" as appropriate, for better-looking
output.
2004-11-15 06:32:15 +00:00
Neil Conway 8295c27c89 Add documentation for the new "dollar quoting" feature, and update existing
examples to use dollar quoting when appropriate. Original patch from David
Fetter, additional work and editorializing by Neil Conway.
2004-05-16 23:22:08 +00:00
Neil Conway c934cf1e96 Add a few more cross-references where appropriate, add more text about
the FROM clause and an example to the UPDATE reference page, and make
a few other SGML tweaks.
2004-03-03 22:22:24 +00:00
PostgreSQL Daemon 969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
Tom Lane e1b47c2dbd Minor copy-editing. 2003-11-06 22:21:47 +00:00
Peter Eisentraut 1d27de4cf4 Random copy-editing. 2003-11-04 09:55:39 +00:00
Peter Eisentraut 8442a92e5a Spell checking, consistent terminology. 2003-11-01 01:56:29 +00:00
Tom Lane 6e59122490 Update obsolete examples of error messages; various other minor editing. 2003-09-12 22:17:24 +00:00
Peter Eisentraut c326d8f4f2 Add/edit index entries. 2003-08-31 17:32:24 +00:00
Tom Lane 0684043e39 Minor copy-editing. 2003-08-14 23:13:27 +00:00
Peter Eisentraut a6554df4f7 In an effort to reduce the total number of chapters, combine the small
chapters on extending types, operators, and aggregates into the extending
functions chapter.  Move the information on how to call table functions
into the queries chapter.  Remove some outdated information that is
already present in a better form in other parts of the documentation.
2003-04-10 01:22:45 +00:00
Peter Eisentraut 706a32cdf6 Big editing for consistent content and presentation. 2003-03-13 01:30:29 +00:00
Peter Eisentraut 1b342df00a Merge documentation updates from 7.3 branch. 2002-11-11 20:14:04 +00:00
Tom Lane c918be6a17 Update description of numeric constants to match 7.3 reality.
Miscellaneous other copy-editing.
2002-10-20 05:05:46 +00:00
Peter Eisentraut de96cd5e3a Revision 2002-09-20 18:39:41 +00:00
Peter Eisentraut 6f4a9fb119 Add User's Guide chapters on Data Definition and Data Manipulation.
Still needs to be filled with more information, but it gives us a
framework to have a User's Guide with complete coverage of the basic
SQL operations.  Move arrays into data type chapter, inheritance into
DDL chapter (for now).

Make <comment>s show up in the output while the version number ends in
"devel".

Allow cross-book references with entities &cite-user; etc.
2002-08-05 19:43:31 +00:00
Tom Lane e358a61d76 Updates for schema features. 2002-04-25 20:14:43 +00:00
Peter Eisentraut 651a639b8b proof-reading 2001-11-28 20:49:10 +00:00
Thomas G. Lockhart 2475e87481 Deprecate 'current' for date/time input.
Fix up references to "PostgreSQL" rather than "Postgres". Was roughly
 evenly split between the two before. ref/ files not yet done.
2001-11-21 05:53:41 +00:00
Tom Lane 9b03776ff2 A bunch of small doco updates motivated by scanning the comments on
the interactive docs.
2001-11-19 03:58:25 +00:00
Peter Eisentraut ede8724010 Move the indexterms around so they don't affect formatting 2001-11-08 23:40:40 +00:00
Peter Eisentraut ffb8f73890 Bunch of copy fitting and style sheet tweakage to get decent looking print
output (from pdfjadetex).  Also updated instructions to install documentation
processing toolchain.
2001-10-09 18:46:00 +00:00
Peter Eisentraut 84956e71a3 Markup additions and spell check. (covers User's Guide) 2001-09-09 17:21:59 +00:00
Tatsuo Ishii 7ecff3f39c Fix typo. 2001-08-30 08:16:42 +00:00
Peter Eisentraut 01839df6dd Add index. Only some parts of the manual set have index entries so far... 2001-05-12 22:51:36 +00:00
Peter Eisentraut 0967057b5d minor copy editing 2001-03-24 23:03:26 +00:00
Tom Lane 52cacf46b4 Improve documentation of JOIN syntax. Explain NATURAL as an alternative
to ON and USING for specifying the join condition, not as an independent
kind of join semantics.
2001-02-15 04:10:54 +00:00
Peter Eisentraut b08e00b2ae Fix tag. 2001-02-13 21:13:11 +00:00
Tom Lane a25a785f6d Minor improvements and copy-editing. 2001-02-10 08:30:13 +00:00
Bruce Momjian a1c68b4e6b A patch for the GROUP BY/HAVING example. p.date should be s.date.
Robert B. Easter
2001-02-01 19:13:47 +00:00
Peter Eisentraut 21a3857f1f Rip out table expression section from SQL syntax chapter and develop it
into new chapter on query (SELECT) syntax.  In the end this should become
a narrative and example-filled counterpart to the SELECT reference page.
2001-01-22 23:34:33 +00:00