Commit Graph

70 Commits

Author SHA1 Message Date
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
Peter Eisentraut
f98f6ee064 array_length() function, and for SQL compatibility also cardinality()
function as a special case.

This version still has the suspicious behavior of returning null for an
empty array (rather than zero), but this may need a wholesale revision of
empty array behavior, currently under discussion.

Jim Nasby, Robert Haas, Peter Eisentraut
2008-11-12 13:09:28 +00:00
Peter Eisentraut
f7ad874ca8 Since SQL:2003, the array size specification in the SQL ARRAY syntax has
been optional.
2008-10-29 11:24:53 +00:00
Alvaro Herrera
1fcb977a13 Add generate_subscripts, a series-generation function which generates an
array's subscripts.

Pavel Stehule, some editorialization by me.
2008-04-28 14:48:58 +00:00
Alvaro Herrera
a1d479f518 Add SGML ID attributes to the arrays subsections, and a few index entries for
them.
2008-04-27 04:33:27 +00:00
Tom Lane
2d013c41a3 Fix bad spelling and worse grammar in recent doc commits. Propagate
pg_dump --ignore-version comments into pg_dumpall and pg_restore pages.
2008-03-26 16:34:47 +00:00
Bruce Momjian
9469d083e5 Improve documentation for odd array slice behavior. 2008-03-26 14:43:20 +00:00
Tom Lane
04d919a11a Fix array_dims() example to be consistent with the data previously shown.
Christian Rossow
2007-06-07 14:49:56 +00:00
Tom Lane
bc8036fc66 Support arrays of composite types, including the rowtypes of regular tables
and views (but not system catalogs, nor sequences or toast tables).  Get rid
of the hardwired convention that a type's array type is named exactly "_type",
instead using a new column pg_type.typarray to provide the linkage.  (It still
will be named "_type", though, except in odd corner cases such as
maximum-length type names.)

Along the way, make tracking of owner and schema dependencies for types more
uniform: a type directly created by the user has these dependencies, while a
table rowtype or auto-generated array type does not have them, but depends on
its parent object instead.

David Fetter, Andrew Dunstan, Tom Lane
2007-05-11 17:57:14 +00:00
Tom Lane
146c83c045 Fix some now-obsolete comments about the space used by various data
types.
2007-04-06 19:22:38 +00:00
Tom Lane
50acd427a5 Fix broken markup, improve wording. 2007-03-02 06:01:01 +00:00
Bruce Momjian
ff0d71e263 Spell check on array patch. 2007-02-20 14:54:47 +00:00
Bruce Momjian
1b52359d90 Update array slice documentation to be clearer. 2007-02-20 14:34:25 +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
Bruce Momjian
1a62813464 Add missing colon. 2007-01-31 04:12:01 +00:00
Bruce Momjian
4ed9f1d9b7 Update documentation for backslashes to mention escape string syntax
more, and standard_conforming_strings less, because in the future non-E
strings will not treat backslashes specially.

Also use E'' strings where backslashes are used in examples. (The
existing examples would have drawn warnings.)

Backpatch to 8.2.X.
2007-01-30 22:29:23 +00:00
Tom Lane
352a56ba68 Allow assignment to array elements not contiguous with those already
present; intervening positions are filled with nulls.  This behavior
is required by SQL99 but was not implementable before 8.2 due to lack
of support for nulls in arrays.  I have only made it work for the
one-dimensional case, which is all that SQL99 requires.  It seems quite
complex to get it right in higher dimensions, and since we never allowed
extension at all in higher dimensions, I think that must count as a
future feature addition not a bug fix.
2006-09-29 21:22:21 +00:00
Bruce Momjian
12049d343e Revert documentation mention of array dimension checking, in next paragraph. 2006-05-09 23:12:54 +00:00
Bruce Momjian
0c9fab6c3b Mention array dimmensions are not enforced either. 2006-05-09 16:31:23 +00:00
Bruce Momjian
efe3de07e9 Removes or minimizes some documentation mentions of backward
compatibility for release 7.2 and earlier.  I have not altered any
mentions of release 7.3 or later.  The release notes were not modified,
so the changes are still documented, just not in the main docs.
2006-04-23 03:39:52 +00:00
Tom Lane
1e9a1a70ad Change array_push and array_cat so that they retain the lower bound of
the array (for array_push) or higher-dimensional array (for array_cat)
rather than decrementing it as before.  This avoids generating lower
bounds other than one for any array operation within the SQL spec.  Per
recent discussion.
Interestingly, this seems to have been the original behavior, because
while updating the docs I noticed that a large fraction of relevant
examples were *wrong* for the old behavior and are now right.  Is it
worth correcting this in the back-branch docs?
2005-11-19 01:50:08 +00:00
Tom Lane
cecb607559 Make SQL arrays support null elements. This commit fixes the core array
functionality, but I still need to make another pass looking at places
that incidentally use arrays (such as ACL manipulation) to make sure they
are null-safe.  Contrib needs work too.
I have not changed the behaviors that are still under discussion about
array comparison and what to do with lower bounds.
2005-11-17 22:14:56 +00:00
Peter Eisentraut
39dfbe5791 Spellchecking run, final cleanups 2005-11-04 23:14:02 +00:00
Tom Lane
03381695c6 Avoid referring to a specific version of the SQL standard except where
necessary, and be careful to refer to the right version where it is
useful to do so.  This partially reverts an ill-considered search and
replace from a few months ago.
2005-11-04 02:56:31 +00:00
Neil Conway
c3f1b0f4dd This doc patch replaces all inappropriate references to SQL:1999 when it
is used as if it were the latest (and/or still valid) SQL standard.
SQL:2003 is used in its place. Patch from Simon Riggs.
2005-07-14 06:17:36 +00:00
Tom Lane
e507399790 Document array behavior for out-of-range subscripts. 2005-02-06 20:59:30 +00:00
Tom Lane
f8ffb60492 A small pass of docs review and copy-editing. 2004-12-23 05:37:40 +00:00
Peter Eisentraut
5ec30faee6 Spell checker run 2004-12-13 18:05:10 +00:00
Peter Eisentraut
49cbef7947 Update of conformance information to SQL:2003
by Troels Arvin, Simon Riggs, Elein Mustain

Make spelling of SQL standard names uniform.
2004-11-27 21:27:08 +00:00
Neil Conway
ec7a6bd9a2 Replace "--" and "---" with "&mdash;" as appropriate, for better-looking
output.
2004-11-15 06:32:15 +00:00
Joe Conway
4187adc631 Minor clarification of documentation regarding trailing whitespace. 2004-08-08 05:55:55 +00:00
Joe Conway
cb50ee286d Tighened up syntax checking of array input processing considerably. Junk that
was previously allowed in odd places with odd results now causes an ERROR.
Also changed behavior with respect to whitespace -- trailing whitespace is
now ignored as well as leading whitespace (which has always been ignored).

Documentation updated to reflect change in whitespace handling. Also some
refactoring to what I believe is a more sensible order of several paragraphs.
2004-08-08 05:01:55 +00:00
Joe Conway
0e13d627be Require that array literals produce "rectangular" arrays, i.e. all the
subarrays of a given dimension have the same number of elements/subarrays.

Also repair a longstanding undocumented (as far as I can see) ability to
explicitly set array bounds in the array literal syntax. It now can
deal properly with negative array indicies. Modify array_out so that
arrays with non-standard lower bounds (i.e. not 1) are output with
the expicit dimension syntax. This fixes a longstanding issue whereby
arrays with non-default lower bounds had them changed to default
after a dump/reload cycle.

Modify regression tests and docs to suit, and add some minimal
documentation regarding the explicit dimension syntax.
2004-08-05 03:30:44 +00:00
Tom Lane
982d005d62 Some preliminary documentation for composite-type stuff. 2004-06-07 04:04:47 +00:00
PostgreSQL Daemon
969685ad44 $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +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
Peter Eisentraut
c326d8f4f2 Add/edit index entries. 2003-08-31 17:32:24 +00:00
Tom Lane
432fb5b886 Updates for array documentation, from Joe Conway. 2003-08-19 06:06:48 +00:00
Tom Lane
5bfb0540b0 Update docs for 7.4 array features and polymorphic functions.
This is Joe Conway's patch of 7-Aug plus further editorializing
of my own.
2003-08-09 22:50:22 +00:00
Tom Lane
b3c0551eda Create real array comparison functions (that use the element datatype's
comparison functions), replacing the highly bogus bitwise array_eq.  Create
a btree index opclass for ANYARRAY --- it is now possible to create indexes
on array columns.
Arrange to cache the results of catalog lookups across multiple array
operations, instead of repeating the lookups on every call.
Add string_to_array and array_to_string functions.
Remove singleton_array, array_accum, array_assign, and array_subscript
functions, since these were for proof-of-concept and not intended to become
supported functions.
Minor adjustments to behavior in some corner cases with empty or
zero-dimensional arrays.

Joe Conway (with some editorializing by Tom Lane).
2003-06-27 00:33:26 +00:00
Bruce Momjian
111d8e522b Back out array mega-patch.
Joe Conway
2003-06-25 21:30:34 +00:00
Bruce Momjian
46bf651480 Array mega-patch.
Joe Conway
2003-06-24 23:14:49 +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
Bruce Momjian
50e726a2c3 Add documentation for array_upper/lower(). 2002-11-10 00:32:16 +00:00
Peter Eisentraut
bc49968764 Add more appropriate markup. 2002-09-21 18:32:54 +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