Commit Graph

355 Commits

Author SHA1 Message Date
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
Bruce Momjian ae875d318e Update documentation for pg_get_serial_sequence() function. 2007-01-30 02:39:27 +00:00
Peter Eisentraut 48ba3f5711 Update documentation on XML functions 2007-01-29 13:24:30 +00:00
Neil Conway 726f0807ad Update docs for recent change to setseed() return value. 2007-01-20 21:59:34 +00:00
Neil Conway cf57ef4e50 Implement width_bucket() for the float8 data type.
The implementation is somewhat ugly logic-wise, but I don't see an
easy way to make it more concise.

When writing this, I noticed that my previous implementation of
width_bucket() doesn't handle NaN correctly:

    postgres=# select width_bucket('NaN', 1, 5, 5);
     width_bucket
    --------------
                6
    (1 row)

AFAICS SQL:2003 does not define a NaN value, so it doesn't address how
width_bucket() should behave here. The patch changes width_bucket() so
that ereport(ERROR) is raised if NaN is specified for the operand or the
lower or upper bounds to width_bucket(). For float8, NaN is disallowed
for any of the floating-point inputs, and +/- infinity is disallowed
for the histogram bounds (but allowed for the operand).

Update docs and regression tests, bump the catversion.
2007-01-16 21:41:14 +00:00
Tom Lane 9a54b76b39 Fix handling of CC (century) format spec in to_date/to_char. According to
standard convention the 21st century runs from 2001-2100, not 2000-2099,
so make it work like that.  Per bug #2885 from Akio Iwaasa.

Backpatch to 8.2, but no further, since this is really a definitional
change; users of older branches are probably more interested in stability.
2007-01-12 23:34:55 +00:00
Bruce Momjian 92dffbd029 Update to_char("CC") description. 2007-01-12 20:06:10 +00:00
Peter Eisentraut 8c1de5fb00 Initial SQL/XML support: xml data type and initial set of functions. 2006-12-21 16:05:16 +00:00
Bruce Momjian f14d43d2d3 Document that to_char() "TM" is controlled by lc_messages. 2006-11-25 00:38:53 +00:00
Bruce Momjian 016e0b4177 For to_char() day/month abbrevitions, mention "3 chars in English,
localized lengths vary".
2006-11-20 20:20:18 +00:00
Peter Eisentraut 0ff4352d7a Add some real descriptions to the multiargument aggregate functions rather
than just showing the incomprehensible formulas.
2006-10-23 19:57:37 +00:00
Peter Eisentraut 0f763503ff Spellchecking and such 2006-10-23 18:10:32 +00:00
Tom Lane e69c09c1e9 date_trunc also accepts 'quarter'. Noted by Yoshihisa Nakano. 2006-10-01 18:54:31 +00:00
Tom Lane 673a573dcc Remove duplicate (and now incorrect) documentation for row-wise IS [NOT]
NULL.  Noted by Teodor.
2006-09-29 18:36:45 +00:00
Tom Lane f213131f20 Fix IS NULL and IS NOT NULL tests on row-valued expressions to conform to
the SQL spec, viz IS NULL is true if all the row's fields are null, IS NOT
NULL is true if all the row's fields are not null.  The former coding got
this right for a limited number of cases with IS NULL (ie, those where it
could disassemble a ROW constructor at parse time), but was entirely wrong
for IS NOT NULL.  Per report from Teodor.

I desisted from changing the behavior for arrays, since on closer inspection
it's not clear that there's any support for that in the SQL spec.  This
probably needs more consideration.
2006-09-28 20:51:43 +00:00
Tom Lane e893e87530 Update timezone documentation to reflect current reality: instead of
giving tables of known timezone names, refer the user to the system views.
Joachim Wieland
2006-09-22 16:20:00 +00:00
Tom Lane 0efa510bf7 Add documentation for new in-core advisory lock functions. Merlin Moncure 2006-09-20 23:43:22 +00:00
Bruce Momjian 32cebaecff Remove emacs info from footer of SGML files. 2006-09-16 00:30:20 +00:00
Tom Lane 65ab9f4f24 Add a couple of information functions to support direct checks on whether
a schema is our own temp schema or another backend's temp schema, and use
these in place of some former kluges in information_schema.  Per my
proposal of yesterday.
2006-09-14 22:05:06 +00:00
Tom Lane 69b7c99265 Add missing documentation for new anyarray-overlap operator. 2006-09-10 19:03:57 +00:00
Tom Lane ba920e1c91 Rename contains/contained-by operators to @> and <@, per discussion that
agreed these symbols are less easily confused.  I made new pg_operator
entries (with new OIDs) for the old names, so as to provide backward
compatibility while making it pretty easy to remove the old names in
some future release cycle.  This commit only touches the core datatypes,
contrib will be fixed separately.
2006-09-10 00:29:35 +00:00
Tom Lane 7bae5a289c Get rid of the separate RULE privilege for tables: now only a table's owner
can create or modify rules for the table.  Do setRuleCheckAsUser() while
loading rules into the relcache, rather than when defining a rule.  This
ensures that permission checks for tables referenced in a rule are done with
respect to the current owner of the rule's table, whereas formerly ALTER TABLE
OWNER would fail to update the permission checking for associated rules.
Removal of separate RULE privilege is needed to prevent various scenarios
in which a grantee of RULE privilege could effectively have any privilege
of the table owner.  For backwards compatibility, GRANT/REVOKE RULE is still
accepted, but it doesn't do anything.  Per discussion here:
http://archives.postgresql.org/pgsql-hackers/2006-04/msg01138.php
2006-09-05 21:08:36 +00:00
Bruce Momjian 7d03215f31 Update setseed() documentation. 2006-09-04 21:47:25 +00:00
Bruce Momjian 04b84f5a93 Generalize width_bucket() documentation because b1/b2 can be
interchanged.
2006-08-22 00:49:19 +00:00
Tom Lane 2b2a50722c Fix all known problems with pg_dump's handling of serial sequences
by abandoning the idea that it should say SERIAL in the dump.  Instead,
dump serial sequences and column defaults just like regular ones.
Add a new backend command ALTER SEQUENCE OWNED BY to let pg_dump recreate
the sequence-to-column dependency that was formerly created "behind the
scenes" by SERIAL.  This restores SERIAL to being truly "just a macro"
consisting of component operations that can be stated explicitly in SQL.
Furthermore, the new command allows sequence ownership to be reassigned,
so that old mistakes can be cleaned up.

Also, downgrade the OWNED-BY dependency from INTERNAL to AUTO, since there
is no longer any very compelling argument why the sequence couldn't be
dropped while keeping the column.  (This forces initdb, to be sure the
right kinds of dependencies are in there.)

Along the way, add checks to prevent ALTER OWNER or SET SCHEMA on an
owned sequence; you can now only do this indirectly by changing the
owning table's owner or schema.  This is an oversight in previous
releases, but probably not worth back-patching.
2006-08-21 00:57:26 +00:00
Tom Lane e8ea9e9587 Implement archive_timeout feature to force xlog file switches to occur no more
than N seconds apart.  This allows a simple, if not very high performance,
means of guaranteeing that a PITR archive is no more than N seconds behind
real time.  Also make pg_current_xlog_location return the WAL Write pointer,
add pg_current_xlog_insert_location to return the Insert pointer, and fix
pg_xlogfile_name_offset to return its results as a two-element record instead
of a smashed-together string, as per recent discussion.

Simon Riggs
2006-08-17 23:04:10 +00:00
Tom Lane 704ddaaa09 Add support for forcing a switch to a new xlog file; cause such a switch
to happen automatically during pg_stop_backup().  Add some functions for
interrogating the current xlog insertion point and for easily extracting
WAL filenames from the hex WAL locations displayed by pg_stop_backup
and friends.  Simon Riggs with some editorialization by Tom Lane.
2006-08-06 03:53:44 +00:00
Tom Lane 1249cf8f38 SQL2003-standard statistical aggregates, by Sergey Koposov. I've added only
the float8 versions of the aggregates, which is all that the standard requires.
Sergey's original patch also provided versions using numeric arithmetic,
but given the size and slowness of the code, I doubt we ought to include
those in core.
2006-07-28 18:33:04 +00:00
Neil Conway c1e59cc5d9 Minor documentation tweak: in the tables of functions and operators,
don't include a space between the function name and the parenthesis
that begins its parameter list, for consistency.
2006-07-16 23:59:58 +00:00
Neil Conway f2a8aa0f89 Reorder the entries in the function section of the manual, to ensure they
are alphabetically ordered. I believe the tables were correctly ordered in
the past, but some of them had subsequently regressed.
2006-07-13 23:59:47 +00:00
Neil Conway 2fa7a041f3 Correct the description of the pg_get_viewdef() function. Do some nearby
SGML cleanup: sort table entries alphabetically.
2006-07-11 19:11:26 +00:00
Bruce Momjian a77275fe3b Please find attached two patches for documentation and regression tests
for the usage of full time zone names.

Joachim Wieland
2006-07-06 01:46:38 +00:00
Tom Lane eaf8f312c7 Some editorial work on the documentation of the current-date/time
functions.
2006-06-19 16:13:01 +00:00
Peter Eisentraut 5266f221a2 Merge postmaster and postgres command into just postgres. postmaster
symlink is kept for now for compatibility.  To call single-user mode, use
postgres --single.
2006-06-18 15:38:37 +00:00
Bruce Momjian eb5558bce8 Fix to_ascii() markup error. 2006-06-15 17:52:48 +00:00
Bruce Momjian 712e824ff1 Move list of supported to_ascii() encodings from footnote to main
description.

Nis Jorgensen
2006-06-15 17:38:26 +00:00
Bruce Momjian b6477c6295 Add regexp_replace() to string functions section.
Joachim Wieland
2006-05-30 11:54:51 +00:00
Bruce Momjian 45ec63cb24 Change <type>string</> to <parameter>string</>. 2006-05-18 03:18:24 +00:00
Bruce Momjian d6a35c8125 Make function param_name/type documentation more consistent. 2006-05-18 00:50:08 +00:00
Tom Lane 82a2881c5b Code review for GRANT CONNECT patch. Spell the privilege as CONNECT not
CONNECTION, fix a number of places that were missed (eg pg_dump support),
avoid executing an extra search of pg_database during startup.
2006-04-30 21:15:33 +00:00
Bruce Momjian e6004f0151 Add statement_timestamp(), clock_timestamp(), and
transaction_timestamp() (just like now()).

Also update statement_timeout() to mention it is statement arrival time
that is measured.

Catalog version updated.
2006-04-25 00:25:22 +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
Neil Conway 0ebf1cc834 Implement 4 new aggregate functions from SQL2003. Specifically: var_pop(),
var_samp(), stddev_pop(), and stddev_samp(). var_samp() and stddev_samp()
are just renamings of the historical Postgres aggregates variance() and
stddev() -- the latter names have been kept for backward compatibility.
This patch includes updates for the documentation and regression tests.
The catversion has been bumped.

NB: SQL2003 requires that DISTINCT not be specified for any of these
aggregates. Per discussion on -patches, I have NOT implemented this
restriction: if the user asks for stddev(DISTINCT x), presumably they
know what they are doing.
2006-03-10 20:15:28 +00:00
Bruce Momjian 497b5ad928 Make $PostgreSQL CVS tags consistent for SGML files. 2006-03-10 19:10:50 +00:00
Bruce Momjian 135fe1899d SGML typo fix. 2006-03-06 22:54:14 +00:00
Bruce Momjian d69b163247 Attached is the new patch. To summarize:
- new function justify_interval(interval)
   - modified function justify_hours(interval)
   - modified function justify_days(interval)

These functions are defined to meet the requirements as discussed in
this thread.  Specifically:

   - justify_hours makes certain the sign bit on the hours
     matches the sign bit on the days.  It only checks the
     sign bit on the days, and not the months, when
     determining if the hours should be positive or negative.
     After the call, -24 < hours < 24.

   - justify_days makes certain the sign bit on the days
     matches the sign bit on the months.  It's behavior does
     not depend on the hours, nor does it modify the hours.
     After the call, -30 < days < 30.

   - justify_interval makes sure the sign bits on all three
     fields months, days, and hours are all the same.  After
     the call, -24 < hours < 24 AND -30 < days < 30.

Mark Dilger
2006-03-06 22:49:17 +00:00
Bruce Momjian 7d40942a27 in the docs, the function "ascii(text)" is described as
returning "ASCII code of the first character of the argument"

(see
http://www.postgresql.org/docs/8.1/interactive/functions-string.html,
Table  9-6. "Other String Functions").

Presumably this should read "ASCII code of the first byte of the
argument",
which is what is returned when the argument is a multi-byte character
(although then with UTF-8 at least that might not necessarily be an
ASCII
code).

Ian Barwick
2006-03-06 04:53:50 +00:00
Bruce Momjian 43e9bab94a Rename Online Backup to Continuous Archiving. 2006-03-03 22:02:08 +00:00
Peter Eisentraut 1b658473ea Add support for Windows codepages 1253, 1254, 1255, and 1257 and clean
up a bunch of the support utilities.

In src/backend/utils/mb/Unicode remove nearly duplicate copies of the
UCS_to_XXX perl script and replace with one version to handle all generic
files.  Update the Makefile so that it knows about all the map files.
This produces a slight difference in some of the map files, using a
uniform naming convention and not mapping the null character.

In src/backend/utils/mb/conversion_procs create a master utf8<->win
codepage function like the ISO 8859 versions instead of having a separate
handler for each conversion.

There is an externally visible change in the name of the win1258 to utf8
conversion.  According to the documentation notes, it was named
incorrectly and this changes it to a standard name.

Running the Unicode mapping perl scripts has shown some additional mapping
changes in koi8r and iso8859-7.
2006-02-18 16:15:23 +00:00
Bruce Momjian f695750c43 Allow to_char() to print localized month and day names.
Euler Taveira de Oliveira
2006-02-12 04:44:15 +00:00