Commit Graph

570 Commits

Author SHA1 Message Date
Bruce Momjian b2c5b3d175 Add links to documentation from 9.1 release notes. 2011-03-19 23:59:33 -04:00
Bruce Momjian 0191e120e6 Document that the timestamp returned by pg_last_xact_replay_timestamp is
the time on the primary that the transaction was generated.
2011-03-18 19:18:08 -04:00
Bruce Momjian 7a8f43968a In docs, rename "backwards compatibility" to "backward compatibility"
for consistency.
2011-03-11 14:33:10 -05:00
Bruce Momjian ffe92d15d5 Document that to_char('FM') removes only trailing zeros. 2011-03-11 10:48:30 -05:00
Bruce Momjian 59bacbe147 Adds index entries for session_user and pg_describe_object
Removes extraneous closing parenthesis from pg_describe_object
Puts pg_describe_object and has_sequence_privilege in correct
alphabetical position in function listing

Thom Brown
2011-03-11 10:23:59 -05:00
Bruce Momjian cbd2811461 Improve extract(day) documentation with interval values. 2011-03-11 08:17:49 -05:00
Tom Lane 7564654adf Revert addition of third argument to format_type().
Including collation in the behavior of that function promotes a world view
we do not want.  Moreover, it was producing the wrong behavior for pg_dump
anyway: what we want is to dump a COLLATE clause on attributes whose
attcollation is different from the underlying type, and likewise for
domains, and the function cannot do that for us.  Doing it the hard way
in pg_dump is a bit more tedious but produces more correct output.

In passing, fix initdb so that the initial entry in pg_collation is
properly pinned.  It was droppable before :-(
2011-03-10 17:30:46 -05:00
Robert Haas 1c3b434a08 Add missing index terms for recovery control functions.
Fujii Masao
2011-03-10 14:29:53 -05:00
Tom Lane 49a08ca1e9 Adjust the permissions required for COMMENT ON ROLE.
Formerly, any member of a role could change the role's comment, as of
course could superusers; but holders of CREATEROLE privilege could not,
unless they were also members.  This led to the odd situation that a
CREATEROLE holder could create a role but then could not comment on it.
It also seems a bit dubious to let an unprivileged user change his own
comment, let alone those of group roles he belongs to.  So, change the
rule to be "you must be superuser to comment on a superuser role, or
hold CREATEROLE to comment on non-superuser roles".  This is the same
as the privilege check for creating/dropping roles, and thus fits much
better with the rule for other object types, namely that only the owner
of an object can comment on it.

In passing, clean up the documentation for COMMENT a little bit.

Per complaint from Owen Jacobson and subsequent discussion.
2011-03-09 11:28:34 -05:00
Tom Lane cfcdc99db6 Improve description of inquiry functions that accept regclass.
Per a suggestion from Thom Brown, though this is not his proposed patch.
2011-03-07 16:21:26 -05:00
Heikki Linnakangas 6eba5a7c57 Change pg_last_xlog_receive_location() not to move backwards. That makes
it a lot more useful for determining which standby is most up-to-date,
for example. There was long discussions on whether overwriting existing
existing WAL makes sense to begin with, and whether we should do some more
extensive variable renaming, but this change nevertheless seems quite
uncontroversial.

Fujii Masao, reviewed by Jeff Janes, Robert Haas, Stephen Frost.
2011-03-01 20:54:35 +02:00
Bruce Momjian 721ea41f14 Fix markup for pg_options_to_table() to report the return column names,
per suggestion from Andrew.
2011-02-27 03:50:12 -05:00
Bruce Momjian 58838a7a52 Document that pg_options_to_table() also works for
pg_attribute.attoptions.
2011-02-26 12:47:29 -05:00
Bruce Momjian 86434afb11 Fix doc patch --- pg_options_to_table() returns "setof record". 2011-02-26 12:26:59 -05:00
Bruce Momjian 772dcfe7c0 Document pg_options_to_table() (not previously documented) 2011-02-26 01:56:49 -05:00
Robert Haas 79ad8fc5f8 Named restore point improvements.
Emit a log message when creating a named restore point, and improve
documentation for pg_create_restore_point().

Euler Taveira de Oliveira, 	per suggestions from Thom Brown, with some
additional wordsmithing by me.
2011-02-24 19:02:00 -05:00
Itagaki Takahiro 62c7bd31c8 Add transaction-level advisory locks.
They share the same locking namespace with the existing session-level
advisory locks, but they are automatically released at the end of the
current transaction and cannot be released explicitly via unlock
functions.

Marko Tiikkaja, reviewed by me.
2011-02-18 14:05:12 +09:00
Peter Eisentraut 414c5a2ea6 Per-column collation support
This adds collation support for columns and domains, a COLLATE clause
to override it per expression, and B-tree index support.

Peter Eisentraut
reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
2011-02-08 23:04:18 +02:00
Simon Riggs c016ce7281 Named restore points in recovery. Users can record named points, then
new recovery.conf parameter recovery_target_name allows PITR to
specify named points as recovery targets.

Jaime Casanova, reviewed by Euler Taveira de Oliveira, plus minor edits
2011-02-08 19:39:08 +00:00
Simon Riggs 8c6e3adbf7 Basic Recovery Control functions for use in Hot Standby. Pause, Resume,
Status check functions only. Also, new recovery.conf parameter to
pause_at_recovery_target, default on.

Simon Riggs, reviewed by Fujii Masao
2011-02-08 18:30:22 +00:00
Bruce Momjian ad76242633 remove tags. 2011-02-06 18:44:43 -05:00
Bruce Momjian d56d246e70 Properly capitalize hyphenated words in documentation titles. 2011-02-01 17:00:26 -05:00
Bruce Momjian 5d5678d7c3 Properly capitalize documentation headings; some only had initial-word
capitalization.
2011-01-29 13:01:48 -05:00
Peter Eisentraut 7f40e30309 Improve markup of unnest example 2011-01-07 00:12:20 +02:00
Peter Eisentraut f9e4961b7d Improve array_upper example
The previous example didn't make it clear whether array_upper returned
the last element or the index of the last element.
2011-01-07 00:12:20 +02:00
Magnus Hagander 9b8aff8c19 Add REPLICATION privilege for ROLEs
This privilege is required to do Streaming Replication, instead of
superuser, making it possible to set up a SR slave that doesn't
have write permissions on the master.

Superuser privileges do NOT override this check, so in order to
use the default superuser account for replication it must be
explicitly granted the REPLICATION permissions. This is backwards
incompatible change, in the interest of higher default security.
2010-12-29 11:05:03 +01:00
Magnus Hagander 06004319be Fix list of functions that are restricted to superusers
Move the list of what's restricted to superusers into the table
itself, so it doesn't get missed again.
2010-12-28 10:46:03 +01:00
Robert Haas 290f1603b4 Some copy editing of pg_read_binary_file() patch. 2010-12-15 21:02:31 -05:00
Itagaki Takahiro 03db44eae3 Add pg_read_binary_file() and whole-file-at-once versions of pg_read_file().
One of the usages of the binary version is to read files in a different
encoding from the server encoding.

Dimitri Fontaine and Itagaki Takahiro.
2010-12-16 06:56:28 +09:00
Peter Eisentraut 4fc09ad00c Add index entries for more functions
Also, move index entries into the tables, closer to the function description,
for easier editing in the future.  Resort some tables to be more alphabetical.
Remove the entries for count, max, min, and sum in the tutorial area, because
that was felt to be confusing.

Thom Brown
2010-11-24 00:00:34 +02:00
Peter Eisentraut fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Robert Haas 7504870778 Add new SQL function, format(text).
Currently, three conversion format specifiers are supported: %s for a
string, %L for an SQL literal, and %I for an SQL identifier.  The latter
two are deliberately designed not to overlap with what sprintf() already
supports, in case we want to add more of sprintf()'s functionality here
later.

Patch by Pavel Stehule, heavily revised by me.  Reviewed by Jeff Janes
and, in earlier versions, by Itagaki Takahiro and Tom Lane.
2010-11-20 22:33:27 -05:00
Alvaro Herrera 6cc2deb86e Add pg_describe_object function
This function is useful to obtain textual descriptions of objects as
stored in pg_depend.
2010-11-18 17:06:19 -03:00
Robert Haas 7ba6e4f0e0 Add monitoring function pg_last_xact_replay_timestamp.
Fujii Masao, with a little wordsmithing by me.
2010-11-09 22:52:19 -05:00
Alvaro Herrera 33ae03f400 Document that translate() removes characters in "from" that don't have
a corresponding "to" character.

Author: Josh Kupershmidt
2010-10-16 01:15:10 -03:00
Itagaki Takahiro d0f876ca8c Accept 'public' as a pseudo-role name in has_table_privilege() and friends
to see if a particular privilege has been granted to PUBLIC.

The issue was reported by Jim Nasby.
Patch by Alvaro Herrera, and reviewed by KaiGai Kohei.
2010-10-13 14:37:23 +09:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Bruce Momjian 152c626105 Doc fixes:
- remove excessive table cells
- moving function parameters into function tags rather than having
  them being considered separate
- add return type column on XML2 contrib module functions list and
  removing return types from function
- add table header to XML2 contrib parameter table

Thom Brown

Backpatch to 9.0.X.
2010-09-09 00:48:22 +00:00
Tom Lane 303696c3b4 Install a data-type-based solution for protecting pg_get_expr().
Since the code underlying pg_get_expr() is not secure against malformed
input, and can't practically be made so, we need to prevent miscreants
from feeding arbitrary data to it.  We can do this securely by declaring
pg_get_expr() to take a new datatype "pg_node_tree" and declaring the
system catalog columns that hold nodeToString output to be of that type.
There is no way at SQL level to create a non-null value of type pg_node_tree.
Since the backend-internal operations that fill those catalog columns
operate below the SQL level, they are oblivious to the datatype relabeling
and don't need any changes.
2010-09-03 01:34:55 +00:00
Tom Lane 21076076e9 Clarify documentation of handling of null arguments for aggregates.
Per discussion.
2010-09-01 18:22:29 +00:00
Itagaki Takahiro 49b27ab551 Add string functions: concat(), concat_ws(), left(), right(), and reverse().
Pavel Stehule, reviewed by me.
2010-08-24 06:30:44 +00:00
Peter Eisentraut 5194b9d049 Spell and markup checking 2010-08-17 04:37:21 +00:00
Tom Lane 521c26ebf7 Clarify bit numbering in get_bit/set_bit etc. Per gripe from
Boszormenyi Zoltan.
2010-08-15 21:26:36 +00:00
Tom Lane a0b7b717a4 Add xml_is_well_formed, xml_is_well_formed_document, xml_is_well_formed_content
functions to the core XML code.  Per discussion, the former depends on
XMLOPTION while the others do not.  These supersede a version previously
offered by contrib/xml2.

Mike Fowler, reviewed by Pavel Stehule
2010-08-13 18:36:26 +00:00
Tom Lane 33f43725fb Add three-parameter forms of array_to_string and string_to_array, to allow
better handling of NULL elements within the arrays.  The third parameter
is a string that should be used to represent a NULL element, or should
be translated into a NULL element, respectively.  If the third parameter
is NULL it behaves the same as the two-parameter form.

There are two incompatible changes in the behavior of the two-parameter form
of string_to_array.  First, it will return an empty (zero-element) array
rather than NULL when the input string is of zero length.  Second, if the
field separator is NULL, the function splits the string into individual
characters, rather than returning NULL as before.  These two changes make
this form fully compatible with the behavior of the new three-parameter form.

Pavel Stehule, reviewed by Brendan Jurd
2010-08-10 21:51:00 +00:00
Tom Lane 4dfc457854 Add an xpath_exists() function. This is equivalent to XMLEXISTS except that
it offers support for namespace mapping.

Mike Fowler, reviewed by David Fetter
2010-08-08 19:15:27 +00:00
Tom Lane b0c451e145 Remove the single-argument form of string_agg(). It added nothing much in
functionality, while creating an ambiguity in usage with ORDER BY that at
least two people have already gotten seriously confused by.  Also, add an
opr_sanity test to check that we don't in future violate the newly minted
policy of not having built-in aggregates with the same name and different
numbers of parameters.  Per discussion of a complaint from Thom Brown.
2010-08-05 18:21:19 +00:00
Peter Eisentraut 641459f269 Add xmlexists function
by Mike Fowler, reviewed by Peter Eisentraut
2010-08-05 04:21:54 +00:00
Peter Eisentraut 66424a2848 Fix indentation of verbatim block elements
Block elements with verbatim formatting (literallayout, programlisting,
screen, synopsis) should be aligned at column 0 independent of the surrounding
SGML, because whitespace is significant, and indenting them creates erratic
whitespace in the output.  The CSS stylesheets already take care of indenting
the output.

Assorted markup improvements to go along with it.
2010-07-29 19:34:41 +00:00
Bruce Momjian e6a7416e28 Document more clearly on XML namespaces inside xpath function
Nikolay Samokhvalov
2010-07-03 17:21:48 +00:00