1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-18 17:41:14 +03:00

11409 Commits

Author SHA1 Message Date
Fujii Masao
8dc90b9c4c Add description of pg_stat directory into doc.
Back-patch to 9.3 where pg_stat directory was introduced.
2014-06-05 01:46:31 +09:00
Tom Lane
5c6d3e405f Document permissions needed for pg_database_size and pg_tablespace_size.
Back in 8.3, we installed permissions checks in these functions (see
commits 8bc225e7990a and cc26599b7206).  But we forgot to document that
anywhere in the user-facing docs; it did get mentioned in the 8.3 release
notes, but nobody's looking at that any more.  Per gripe from Suya Huang.
2014-05-08 21:45:14 -04:00
Bruce Momjian
aa0a5198ba docs: properly document psql auto encoding mode
In psql, both stdin and stdout must be terminals to get a client
encoding of 'auto'.

Patch by Albe Laurenz

Backpatch to 9.3.
2014-04-16 19:53:42 -04:00
Tom Lane
d359f71ac0 Fix non-equivalence of VARIADIC and non-VARIADIC function call formats.
For variadic functions (other than VARIADIC ANY), the syntaxes foo(x,y,...)
and foo(VARIADIC ARRAY[x,y,...]) should be considered equivalent, since the
former is converted to the latter at parse time.  They have indeed been
equivalent, in all releases before 9.3.  However, commit 75b39e790 made an
ill-considered decision to record which syntax had been used in FuncExpr
nodes, and then to make equal() test that in checking node equality ---
which caused the syntaxes to not be seen as equivalent by the planner.
This is the underlying cause of bug #9817 from Dmitry Ryabov.

It might seem that a quick fix would be to make equal() disregard
FuncExpr.funcvariadic, but the same commit made that untenable, because
the field actually *is* semantically significant for some VARIADIC ANY
functions.  This patch instead adopts the approach of redefining
funcvariadic (and aggvariadic, in HEAD) as meaning that the last argument
is a variadic array, whether it got that way by parser intervention or was
supplied explicitly by the user.  Therefore the value will always be true
for non-ANY variadic functions, restoring the principle of equivalence.
(However, the planner will continue to consider use of VARIADIC as a
meaningful difference for VARIADIC ANY functions, even though some such
functions might disregard it.)

In HEAD, this change lets us simplify the decompilation logic in
ruleutils.c, since the funcvariadic/aggvariadic flag tells directly whether
to print VARIADIC.  However, in 9.3 we have to continue to cope with
existing stored rules/views that might contain the previous definition.
Fortunately, this just means no change in ruleutils.c, since its existing
behavior effectively ignores funcvariadic for all cases other than VARIADIC
ANY functions.

In HEAD, bump catversion to reflect the fact that FuncExpr.funcvariadic
changed meanings; this is sort of pro forma, since I don't believe any
built-in views are affected.

Unfortunately, this patch doesn't magically fix everything for affected
9.3 users.  After installing 9.3.5, they might need to recreate their
rules/views/indexes containing variadic function calls in order to get
everything consistent with the new definition.  As in the cited bug,
the symptom of a problem would be failure to use a nominally matching
index that has a variadic function call in its definition.  We'll need
to mention this in the 9.3.5 release notes.
2014-04-03 22:02:27 -04:00
Tom Lane
2186533911 Fix documentation about joining pg_locks to other views.
The advice to join to pg_prepared_xacts via the transaction column was not
updated when the transaction column was replaced by virtualtransaction.
Since it's not quite obvious how to do that join, give an explicit example.
For consistency also give an example for the adjacent case of joining to
pg_stat_activity.  And link-ify the view references too, just because we
can.  Per bug #9840 from Alexey Bashtanov.

Michael Paquier and Tom Lane
2014-04-03 14:18:28 -04:00
Tom Lane
64e381a163 Fix documentation about size of interval type.
It's been 16 bytes, not 12, for ages.  This was fixed in passing in HEAD
(commit 146604ec), but as a factual error it should have been back-patched.
Per gripe from Tatsuhito Kasahara.
2014-04-03 11:05:55 -04:00
Noah Misch
244590ebfb Revert "Secure Unix-domain sockets of "make check" temporary clusters."
About half of the buildfarm members use too-long directory names,
strongly suggesting that this approach is a dead end.
2014-03-29 03:14:48 -04:00
Noah Misch
95a3ca3be9 Secure Unix-domain sockets of "make check" temporary clusters.
Any OS user able to access the socket can connect as the bootstrap
superuser and in turn execute arbitrary code as the OS user running the
test.  Protect against that by placing the socket in the temporary data
directory, which has mode 0700 thanks to initdb.  Back-patch to 8.4 (all
supported versions).  The hazard remains wherever the temporary cluster
accepts TCP connections, notably on Windows.

Attempts to run "make check" from a directory with a long name will now
fail.  An alternative not sharing that problem was to place the socket
in a subdirectory of /tmp, but that is only secure if /tmp is sticky.
The PG_REGRESS_SOCK_DIR environment variable is available as a
workaround when testing from long directory paths.

As a convenient side effect, this lets testing proceed smoothly in
builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
like /var/run/postgresql are often unwritable to the build user.

Security: CVE-2014-0067
2014-03-29 01:02:24 -04:00
Noah Misch
afd0d3ff57 Document platform-specificity of unix_socket_permissions.
Back-patch to 8.4 (all supported versions).
2014-03-29 00:53:40 -04:00
Tom Lane
611fc913f4 Revert "Document that Python 2.3 requires cdecimal module for full functionality."
This reverts commit 2a33b796ee27732c1854f41594329afbb9ffba3d.
The change requiring cdecimal is new in 9.4 (see 7919398bac),
so we should not claim previous branches need it.
2014-03-27 17:05:59 -04:00
Tom Lane
2a33b796ee Document that Python 2.3 requires cdecimal module for full functionality.
This has been true for some time, but we were leaving users to discover it
the hard way.

Back-patch to 9.2.  It might've been true before that, but we were claiming
Python 2.2 compatibility before that, so I won't guess at the exact
requirements back then.
2014-03-26 22:43:24 -04:00
Magnus Hagander
a2e3df7b6f Fix typos in pg_basebackup documentation
Joshua Tolley
2014-03-25 11:17:21 +01:00
Fujii Masao
08ca107425 Fix START_REPLICATION syntax in document.
Enclose "TIMELINE tli" part with brackets because it's optional.

Backport to 9.3 where TIMELINE option was introduced.

Noted by Marko Tiikkaja
2014-03-24 19:47:35 +09:00
Tom Lane
d4f8dde3c1 Stamp 9.3.4. 2014-03-17 15:35:47 -04:00
Tom Lane
fc61da7c91 Release notes for 9.3.4, 9.2.8, 9.1.13, 9.0.17, 8.4.21. 2014-03-17 15:28:26 -04:00
Bruce Momjian
28d92026f0 release notes: add item missed in 9.2.5 release
Item is "Prevent errors in WAL replay due to references to uninitialized
empty pages".

Report and text by Andres Freund

Backpatch through 9.2.
2014-03-07 13:45:38 -05:00
Heikki Linnakangas
886c4ebfa3 Fix name of syslog_ident GUC in docs.
Michael Paquier
2014-03-07 10:38:53 +02:00
Alvaro Herrera
9b4bd35aa1 doc: bgw_main takes a Datum argument, not void *.
Per report from James Harper.
2014-02-27 11:41:43 -03:00
Heikki Linnakangas
5a7e75849c Add a GUC to report whether data page checksums are enabled.
Backported from master. It was an oversight in the original data checksums
patch to not have a GUC like this.
2014-02-20 10:46:54 +02:00
Tom Lane
0691fe5047 Stamp 9.3.3. 2014-02-17 14:29:55 -05:00
Tom Lane
4239753338 Last-minute updates for release notes.
Add entries for security issues.

Security: CVE-2014-0060 through CVE-2014-0067
2014-02-17 14:25:40 -05:00
Tom Lane
81f4c2867f Improve documentation about multixact IDs.
Per gripe from Josh Berkus.
2014-02-17 12:21:01 -05:00
Tom Lane
1ec5988f31 Document risks of "make check" in the regression testing instructions.
Since the temporary server started by "make check" uses "trust"
authentication, another user on the same machine could connect to it
as database superuser, and then potentially exploit the privileges of
the operating-system user who started the tests.  We should change
the testing procedures to prevent this risk; but discussion is required
about the best way to do that, as well as more testing than is practical
for an undisclosed security problem.  Besides, the same issue probably
affects some user-written test harnesses.  So for the moment, we'll just
warn people against using "make check" when there are untrusted users on
the same machine.

In passing, remove some ancient advice that suggested making the
regression testing subtree world-writable if you'd built as root.
That looks dangerously insecure in modern contexts, and anyway we
should not be encouraging people to build Postgres as root.

Security: CVE-2014-0067
2014-02-17 11:24:38 -05:00
Noah Misch
30b1c40f98 Document security implications of check_function_bodies.
Back-patch to 8.4 (all supported versions).
2014-02-17 09:33:32 -05:00
Noah Misch
fc4a04a3c4 Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly.  Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls to achieve things he could not
otherwise achieve.  Back-patch to 8.4 (all supported versions).
Non-core procedural language extensions ought to make the same two-line
change to their own validators.

Andres Freund, reviewed by Tom Lane and Noah Misch.

Security: CVE-2014-0061
2014-02-17 09:33:32 -05:00
Noah Misch
475a1fbc41 Shore up ADMIN OPTION restrictions.
Granting a role without ADMIN OPTION is supposed to prevent the grantee
from adding or removing members from the granted role.  Issuing SET ROLE
before the GRANT bypassed that, because the role itself had an implicit
right to add or remove members.  Plug that hole by recognizing that
implicit right only when the session user matches the current role.
Additionally, do not recognize it during a security-restricted operation
or during execution of a SECURITY DEFINER function.  The restriction on
SECURITY DEFINER is not security-critical.  However, it seems best for a
user testing his own SECURITY DEFINER function to see the same behavior
others will see.  Back-patch to 8.4 (all supported versions).

The SQL standards do not conflate roles and users as PostgreSQL does;
only SQL roles have members, and only SQL users initiate sessions.  An
application using PostgreSQL users and roles as SQL users and roles will
never attempt to grant membership in the role that is the session user,
so the implicit right to add or remove members will never arise.

The security impact was mostly that a role member could revoke access
from others, contrary to the wishes of his own grantor.  Unapproved role
member additions are less notable, because the member can still largely
achieve that by creating a view or a SECURITY DEFINER function.

Reviewed by Andres Freund and Tom Lane.  Reported, independently, by
Jonas Sundman and Noah Misch.

Security: CVE-2014-0060
2014-02-17 09:33:32 -05:00
Tom Lane
0a8793333b Release notes for 9.3.3, 9.2.7, 9.1.12, 9.0.16, 8.4.20. 2014-02-16 22:08:30 -05:00
Tom Lane
bfd59426db Update regression testing instructions.
This documentation never got the word about the existence of check-world or
installcheck-world.  Revise to recommend use of those, and document all the
subsidiary test suites.  Do some minor wordsmithing elsewhere, too.

In passing, remove markup related to generation of plain-text regression
test instructions, since we don't do that anymore.

Back-patch to 9.1 where check-world was added.  (installcheck-world exists
in 9.0; but since check-world doesn't, this patch would need additional
work to cover that branch, and it doesn't seem worth the effort.)
2014-02-14 16:50:25 -05:00
Tom Lane
6cafc4fb09 Suggest shell here-documents instead of psql -c for multiple commands.
The documentation suggested using "echo | psql", but not the often-superior
alternative of a here-document.  Also, be more direct about suggesting
that people avoid -c for multiple commands.  Per discussion.
2014-02-14 12:54:43 -05:00
Alvaro Herrera
fb47de2be6 Separate multixact freezing parameters from xid's
Previously we were piggybacking on transaction ID parameters to freeze
multixacts; but since there isn't necessarily any relationship between
rates of Xid and multixact consumption, this turns out not to be a good
idea.

Therefore, we now have multixact-specific freezing parameters:

vacuum_multixact_freeze_min_age: when to remove multis as we come across
them in vacuum (default to 5 million, i.e. early in comparison to Xid's
default of 50 million)

vacuum_multixact_freeze_table_age: when to force whole-table scans
instead of scanning only the pages marked as not all visible in
visibility map (default to 150 million, same as for Xids).  Whichever of
both which reaches the 150 million mark earlier will cause a whole-table
scan.

autovacuum_multixact_freeze_max_age: when for cause emergency,
uninterruptible whole-table scans (default to 400 million, double as
that for Xids).  This means there shouldn't be more frequent emergency
vacuuming than previously, unless multixacts are being used very
rapidly.

Backpatch to 9.3 where multixacts were made to persist enough to require
freezing.  To avoid an ABI break in 9.3, VacuumStmt has a couple of
fields in an unnatural place, and StdRdOptions is split in two so that
the newly added fields can go at the end.

Patch by me, reviewed by Robert Haas, with additional input from Andres
Freund and Tom Lane.
2014-02-13 19:30:30 -03:00
Tom Lane
2d77f16c1d Improve cross-references between minor version release notes.
We have a practice of providing a "bread crumb" trail between the minor
versions where the migration section actually tells you to do something.
Historically that was just plain text, eg, "see the release notes for
9.2.4"; but if you're using a browser or PDF reader, it's a lot nicer
if it's a live hyperlink.  So use "<xref>" instead.  Any argument against
doing this vanished with the recent decommissioning of plain-text release
notes.

Vik Fearing
2014-02-12 19:09:21 -05:00
Bruce Momjian
8247236c63 doc: Postgres date-style date-only output is ISO
Backpatch to 9.3

Report from MauMau
2014-02-12 11:25:04 -05:00
Tom Lane
f1e522696f Don't generate plain-text HISTORY and src/test/regress/README anymore.
Providing this information as plain text was doubtless worth the trouble
ten years ago, but it seems likely that hardly anyone reads it in this
format anymore.  And the effort required to maintain these files (in the
form of extra-complex markup rules in the relevant parts of the SGML
documentation) is significant.  So, let's stop doing that and rely solely
on the other documentation formats.

Per discussion, the plain-text INSTALL instructions might still be worth
their keep, so we continue to generate that file.

Rather than remove HISTORY and src/test/regress/README from distribution
tarballs entirely, replace them with simple stub files that tell the reader
where to find the relevant documentation.  This is mainly to avoid possibly
breaking packaging recipes that expect these files to exist.

Back-patch to all supported branches, because simplifying the markup
requirements for release notes won't help much unless we do it in all
branches.
2014-02-10 20:48:12 -05:00
Robert Haas
5203b6a752 Rephrase text to avoid links in regress.sgml
Otherwise, the standalone regress_README build gets unhappy.
2014-02-03 20:14:46 -05:00
Robert Haas
5056607ae3 Document a few more regression test hazards.
Michael Paquier, reviewed by Christian Kruse
2014-02-03 10:48:58 -05:00
Bruce Momjian
5dc6cab2d2 doc: mention data page checksums in WAL section
Backpatch to 9.3

Adjusted patch from Ian Lawrence Barwick
2014-01-31 19:06:24 -05:00
Bruce Momjian
e3ec8015d0 docs: add mention of index swapping
Backpatch to 9.3

Greg Smith
2014-01-30 12:48:21 -05:00
Andrew Dunstan
56c08df55b Enable building with Visual Studion 2013.
Backpatch to 9.3.

Brar Piening.
2014-01-26 09:45:43 -05:00
Tom Lane
74c32f3455 Improve FILES section of psql reference page.
Primarily, explain where to find the system-wide psqlrc file, per recent
gripe from John Sutton.  Do some general wordsmithing and improve the
markup, too.

Also adjust psqlrc.sample so its comments about file location are somewhat
trustworthy.  (Not sure why we bother with this file when it's empty,
but whatever.)

Back-patch to 9.2 where the startup file naming scheme was last changed.
2014-01-14 19:28:06 -05:00
Heikki Linnakangas
370178172f Add OVERLAPS to index in the docs.
Per report from Adam Mackler and Jonathan Katz
2014-01-13 15:19:24 +02:00
Bruce Momjian
a826773bf6 Update copyright for 2014
Update all files in head, and files COPYRIGHT and legal.sgml in all back
branches.
2014-01-07 16:05:29 -05:00
Tom Lane
140b0626e8 Fix alphabetization in catalogs.sgml.
Some recent patches seem not to have grasped the concept that the catalogs
are described in alphabetical order.
2013-12-30 13:27:54 -05:00
Tom Lane
b57947aa9c Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
2013-12-12 12:39:54 -05:00
Tom Lane
05ec931add Stamp 9.3.2. 2013-12-02 15:57:48 -05:00
Tom Lane
9cb631d984 Update release notes for 9.3.2, 9.2.6, 9.1.11, 9.0.15, 8.4.19. 2013-12-02 15:53:58 -05:00
Peter Eisentraut
19ffa951e6 doc: Put data types in alphabetical order
From: Andreas Karlsson <andreas@proxel.se>
2013-11-27 21:51:56 -05:00
Michael Meskes
55c18bcfa2 Documentation fix for ecpg.
The latest fixes removed a limitation that was still in the docs, so Zoltan updated the docs, too.
2013-11-27 11:14:44 +01:00
Fujii Masao
d982881487 Fix typo in release note.
Backpatch to 9.1.

Josh Kupershmidt
2013-11-27 13:46:34 +09:00
Bruce Momjian
57282cdeda docs: update page format to specify page checksum field
Backpatch to 9.3

Per report from Steffen Hildebrandt
2013-11-19 16:54:42 -05:00
Robert Haas
8674f1fba9 doc: Restore proper alphabetical order.
Colin 't Hart
2013-11-15 08:55:45 -05:00