Commit Graph

482 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
Tom Lane 48938ab506 Allow the second argument of pg_get_expr() to be just zero when deparsing
an expression that's not supposed to contain variables.  Per discussion
with Gevik Babakhani, this eliminates the need for an ugly kluge (namely,
specifying some unrelated relation name).  Remove one such kluge from
pg_dump.
2009-05-26 17:36:05 +00:00
Peter Eisentraut 263144140f Some documentation cleanup for the addition of the KOI8U encoding. Change
all (remaining) mentions of KOI8 to the new canonical form KOI8R.  Add
information about the available conversions for KOI8U.
2009-05-18 08:59:29 +00:00
Tom Lane 1958603145 Remove a useless backslash from a pattern-match example. Michael Toews 2009-05-13 21:53:41 +00:00
Tom Lane c52963ac5f Fix mis-description of XML Schema functions, per discussion. 2009-05-03 21:10:27 +00:00
Bruce Momjian ba36c48e39 Proofreading adjustments for first two parts of documentation (Tutorial
and SQL).
2009-04-27 16:27:36 +00:00
Tom Lane 06e2757277 Remove SQL-compatibility function cardinality(). It is not exactly clear
how this ought to behave for multi-dimensional arrays.  Per discussion,
not having it at all seems better than having it with what might prove
to be the wrong behavior.  We can always add it later when we have consensus
on the correct behavior.
2009-04-09 17:39:50 +00:00
Tom Lane 387060951e Add an optional parameter to pg_start_backup() that specifies whether to do
the checkpoint in immediate or lazy mode.  This is to address complaints
that pg_start_backup() takes a long time even when there's no need to minimize
its I/O consumption.
2009-04-07 00:31:26 +00:00
Tom Lane dff26735d3 Index some array functions, per Mario Splivalo. 2009-04-01 03:32:29 +00:00
Andrew Dunstan c9cab106f6 Remove munging of xml and xpath params to xpath(). The XML must now be a well formed XML document. 2009-03-23 21:00:39 +00:00
Bruce Momjian 65b731bd9d Fix to_timestamp() to not require upper/lower case matching for meridian
designations (AM/PM).  Also separate out matching of a meridian with
periods (e.g. A.M.) and with those without.

Do the same for AD/BC.

Brendan Jurd
2009-02-07 14:16:46 +00:00
Tom Lane 7449427a1e Clean up some loose ends from the column privileges patch: add
has_column_privilege and has_any_column_privilege SQL functions; fix the
information_schema views that are supposed to pay attention to column
privileges; adjust pg_stats to show stats for any column you have select
privilege on; and fix COPY to allow copying a subset of columns if the user
has suitable per-column privileges for all the columns.

To improve efficiency of some of the information_schema views, extend the
has_xxx_privilege functions to allow inquiring about the OR of a set of
privileges in just one call.  This is just exposing capability that already
existed in the underlying aclcheck routines.

In passing, make the information_schema views report the owner's own
privileges as being grantable, since Postgres assumes this even when the grant
option bit is not set in the ACL.  This is a longstanding oversight.

Also, make the new has_xxx_privilege functions for foreign data objects follow
the same coding conventions used by the older ones.

Stephen Frost and Tom Lane
2009-02-06 21:15:12 +00:00
Heikki Linnakangas 14bfea3b75 Change explanation of pg_switch_xlog()'s return value to match code. 2009-01-15 18:19:58 +00:00
Bruce Momjian eb0d7e243a Document that txid_visible_in_snapshot() cannot be used with
subtransaction ids.
2009-01-08 14:46:50 +00:00
Bruce Momjian af96c82019 Document current_query() as being the _client_ query. 2009-01-08 00:44:18 +00:00
Bruce Momjian 1c175cd76a Revert current_query() change to use debug_query_string again; add comment. 2009-01-08 00:13:22 +00:00
Bruce Momjian 12dcf7bb75 Have current_query() use ActivePortal->sourceText rather than
debug_query_string;  this allows current_query() to be more accurate;
docs updated;  per idea from Tom
2009-01-07 21:48:15 +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
Peter Eisentraut cae565e503 SQL/MED catalog manipulation facilities
This doesn't do any remote or external things yet, but it gives modules
like plproxy and dblink a standardized and future-proof system for
managing their connection information.

Martin Pihlak and Peter Eisentraut
2008-12-19 16:25:19 +00:00
Tom Lane 517ae4039e Code review for function default parameters patch. Fix numerous problems as
per recent discussions.  In passing this also fixes a couple of bugs in
the previous variadic-parameters patch.
2008-12-18 18:20:35 +00:00
Peter Eisentraut 455dffbb73 Default values for function arguments
Pavel Stehule, with some tweaks by Peter Eisentraut
2008-12-04 17:51:28 +00:00
Tom Lane c889ebce0a Implement the basic form of UNNEST, ie unnest(anyarray) returns setof
anyelement.  This lacks the WITH ORDINALITY option, as well as the multiple
input arrays option added in the most recent SQL specs.  But it's still a
pretty useful subset of the spec's functionality, and it is enough to
allow obsoleting contrib/intagg.
2008-11-14 00:51:47 +00:00
Tom Lane c23b6fa7b5 Marginal editorial improvements for array_agg patch documentation. 2008-11-13 23:01:09 +00:00
Peter Eisentraut 3379fae6de array_agg aggregate function, as per SQL:2008, but without ORDER BY clause
Rearrange the documentation a bit now that array_agg and xmlagg have similar
semantics and issues.

best of Robert Haas, Jeff Davis, Peter Eisentraut
2008-11-13 15:59:51 +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
Tom Lane 399ad77c66 Improve documentation of pg_typeof, per gripe from David Wheeler. 2008-11-07 22:54:41 +00:00
Peter Eisentraut 254aecb704 ADD array_ndims function
Author: Robert Haas <robertmhaas@gmail.com>
2008-11-04 14:49:12 +00:00
Bruce Momjian ac3797a913 Remove tabs from SGML file. 2008-11-04 00:59:45 +00:00
Andrew Dunstan f0dae70431 suppress_redundant_updates_trigger function. 2008-11-03 20:17:21 +00:00
Tom Lane b8fab2411d Add pg_typeof() function.
Brendan Jurd
2008-11-03 17:51:13 +00:00
Peter Eisentraut 0fec77ae88 SQL:2008 syntax CURRENT_CATALOG, CURRENT_SCHEMA, SET CATALOG, SET SCHEMA. 2008-10-27 09:37:47 +00:00
Tom Lane a303e4dc43 Extend the date type to support infinity and -infinity, analogously to
the timestamp types.  Turns out this doesn't even reduce the available
range of dates, since the restriction to dates that work for Julian-date
arithmetic is much tighter than the int32 range anyway.  Per a longstanding
TODO item.
2008-10-14 17:12:33 +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
Heikki Linnakangas 706a308806 Add relation fork support to pg_relation_size() function. You can now pass
name of a fork ('main' or 'fsm', at the moment) to pg_relation_size() to
get the size of a specific fork. Defaults to 'main', if none given.

While we're at it, modify pg_relation_size to take a regclass as argument,
instead of separate variants taking oid and name. This change is
transparent to typical use where the table name is passed as a string
literal, like pg_relation_size('table'), but will break queries like
pg_relation_size(namecol), where namecol is of type name. text-type input
still works, and using a non-schema-qualified table name is not very
reliable anyway, so this is unlikely to break anyone's queries in practice.
2008-10-03 07:33:10 +00:00
Tom Lane 06edce4c3f Tighten up to_date/to_timestamp so that they are more likely to reject
erroneous input, rather than silently producing bizarre results as formerly
happened.

Brendan Jurd
2008-09-11 17:32:34 +00:00
Tom Lane a0b76dc662 Create a separate grantable privilege for TRUNCATE, rather than having it be
always owner-only.  The TRUNCATE privilege works identically to the DELETE
privilege so far as interactions with the rest of the system go.

Robert Haas
2008-09-08 00:47:41 +00:00
Bruce Momjian 1cfd878643 Clarify documention workding for xip_list().
Simon Riggs
2008-09-07 01:29:36 +00:00
Tom Lane 2c863ca818 Implement a psql command "\ef" to edit the definition of a function.
In support of that, create a backend function pg_get_functiondef().
The psql command is functional but maybe a bit rough around the edges...

Abhijit Menon-Sen
2008-09-06 00:01:25 +00:00
Tom Lane 5618ece82b Code review for array_fill patch: fix inadequate check for array size overflow
and bogus documentation (dimension arrays are int[] not anyarray).  Also the
errhint() messages seem to be really errdetail(), since there is nothing
heuristic about them.  Some other trivial cosmetic improvements.
2008-07-21 04:47:00 +00:00
Tom Lane 69a785b8bf Implement SQL-spec RETURNS TABLE syntax for functions.
(Unlike the original submission, this patch treats TABLE output parameters
as being entirely equivalent to OUT parameters -- tgl)

Pavel Stehule
2008-07-18 03:32:53 +00:00
Bruce Momjian 2c773296f8 Add array_fill() to create arrays initialized with a value.
Pavel Stehule
2008-07-16 00:48:54 +00:00
Bruce Momjian 2fa42cc9ee Fix alignment of SGML array docs. 2008-07-15 18:24:59 +00:00
Peter Eisentraut 76c3c59bd1 Added documentation for function xmlagg. 2008-07-07 16:11:35 +00:00
Tom Lane c63147d6f0 Add a function pg_get_keywords() to let clients find out the set of keywords
known to the SQL parser.  Dave Page
2008-07-03 20:58:47 +00:00
Tom Lane 07a5606735 Make to_char()'s localized month/day names depend on LC_TIME, not LC_MESSAGES.
Euler Taveira de Oliveira
2008-05-19 18:08:16 +00:00
Tom Lane b6d15590f7 Add timestamp and timestamptz versions of generate_series().
Hitoshi Harada
2008-05-04 23:19:24 +00:00
Tom Lane 600da67fbe Add pg_conf_load_time() function to report when the Postgres configuration
files were last loaded.

George Gensure
2008-05-04 21:13:36 +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
Bruce Momjian c4fd93b3f3 Re-enable pg_terminate_backend() using SIGTERM. SIGTERM testing still
needed.
2008-04-17 20:56:41 +00:00