1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-28 05:21:27 +03:00

11040 Commits

Author SHA1 Message Date
Noah Misch
15a8f97b9d 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:33 -05:00
Tom Lane
9649892c33 Release notes for 9.3.3, 9.2.7, 9.1.12, 9.0.16, 8.4.20. 2014-02-16 22:08:34 -05:00
Tom Lane
21bfc74c27 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:28 -05:00
Tom Lane
c40b2d59e0 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:46 -05:00
Tom Lane
22fce59aaf 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:24 -05:00
Tom Lane
dd56051040 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:20 -05:00
Tom Lane
aa00af38c8 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:09 -05:00
Bruce Momjian
8aa6912b8f 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
fcff4bd312 Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.
Pointed out by Gianni Ciolli.
2013-12-12 12:39:57 -05:00
Tom Lane
8b47c9d413 Stamp 9.2.6. 2013-12-02 16:00:18 -05:00
Tom Lane
4993336220 Update release notes for 9.3.2, 9.2.6, 9.1.11, 9.0.15, 8.4.19. 2013-12-02 15:54:01 -05:00
Peter Eisentraut
62e69cb6fb doc: Put data types in alphabetical order
From: Andreas Karlsson <andreas@proxel.se>
2013-11-27 21:52:05 -05:00
Michael Meskes
6bb2972c09 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:15:09 +01:00
Fujii Masao
744fa4d8ea Fix typo in release note.
Backpatch to 9.1.

Josh Kupershmidt
2013-11-27 13:46:19 +09:00
Tom Lane
42f8e268c9 Clarify CREATE FUNCTION documentation about handling of typmods.
The previous text was a bit misleading, as well as unnecessarily vague
about what information would be discarded.  Per gripe from Craig Skinner.
2013-11-13 13:26:44 -05:00
Tom Lane
74aea2af96 Support default arguments and named-argument notation for window functions.
These things didn't work because the planner omitted to do the necessary
preprocessing of a WindowFunc's argument list.  Add the few dozen lines
of code needed to handle that.

Although this sounds like a feature addition, it's really a bug fix because
the default-argument case was likely to crash previously, due to lack of
checking of the number of supplied arguments in the built-in window
functions.  It's not a security issue because there's no way for a
non-superuser to create a window function definition with defaults that
refers to a built-in C function, but nonetheless people might be annoyed
that it crashes rather than producing a useful error message.  So
back-patch as far as the patch applies easily, which turns out to be 9.2.
I'll put a band-aid in earlier versions as a separate patch.

(Note that these features still don't work for aggregates, and fixing that
case will be harder since we represent aggregate arg lists as target lists
not bare expression lists.  There's no crash risk though because CREATE
AGGREGATE doesn't accept defaults, and we reject named-argument notation
when parsing an aggregate call.)
2013-11-06 13:26:38 -05:00
Tom Lane
599942cf49 Improve the error message given for modifying a window with frame clause.
For rather inscrutable reasons, SQL:2008 disallows copying-and-modifying a
window definition that has any explicit framing clause.  The error message
we gave for this only made sense if the referencing window definition
itself contains an explicit framing clause, which it might well not.
Moreover, in the context of an OVER clause it's not exactly obvious that
"OVER (windowname)" implies copy-and-modify while "OVER windowname" does
not.  This has led to multiple complaints, eg bug #5199 from Iliya
Krapchatov.  Change to a hopefully more intelligible error message, and
in the case where we have just "OVER (windowname)", add a HINT suggesting
that omitting the parentheses will fix it.  Also improve the related
documentation.  Back-patch to all supported branches.
2013-11-05 21:58:16 -05:00
Peter Eisentraut
b89cedeffb doc: Remove i18ngurus.com link
The web site is dead, and the Wayback Machine shows that it didn't have
much useful content before.
2013-10-21 06:23:06 -04:00
Bruce Momjian
2a5496f5a7 docs: correct 9.1 and 9.2 release note mention of timeline switch fix
Backpatch through 9.1.

KONDO Mitsumasa
2013-10-15 10:34:04 -04:00
Bruce Momjian
5fbed6b1e1 doc: fix typo in release notes
Backpatch through 8.4

Per suggestion by Amit Langote
2013-10-09 08:44:52 -04:00
Peter Eisentraut
7800229b36 Stamp 9.2.5. 2013-10-07 23:16:13 -04:00
Peter Eisentraut
e2ccba06ac Revert "Document support for VPATH builds of extensions."
This reverts commit 565beb41bdd73611ddb26165b7f6bb8b6157e49d.
2013-10-07 22:42:26 -04:00
Bruce Momjian
df9ede9063 docs: update release notes for 8.4.18, 9.0.14, 9.1.10, 9.2.5, 9.3.1 2013-10-07 21:35:02 -04:00
Andrew Dunstan
565beb41bd Document support for VPATH builds of extensions.
Cédric Villemain and me.
2013-10-06 23:06:10 -04:00
Peter Eisentraut
d565ece23b doc: Correct psycopg URL 2013-10-02 21:34:16 -04:00
Jeff Davis
1bb4b62d3e Improve Range Types and Exclusion Constraints example.
Make the examples self-contained to avoid confusion. Per bug report
8367 from KOIZUMI Satoru.
2013-09-05 07:29:39 -07:00
Tom Lane
9ac5f63cea Don't fail for bad GUCs in CREATE FUNCTION with check_function_bodies off.
The previous coding attempted to activate all the GUC settings specified
in SET clauses, so that the function validator could operate in the GUC
environment expected by the function body.  However, this is problematic
when restoring a dump, since the SET clauses might refer to database
objects that don't exist yet.  We already have the parameter
check_function_bodies that's meant to prevent forward references in
function definitions from breaking dumps, so let's change CREATE FUNCTION
to not install the SET values if check_function_bodies is off.

Authors of function validators were already advised not to make any
"context sensitive" checks when check_function_bodies is off, if indeed
they're checking anything at all in that mode.  But extend the
documentation to point out the GUC issue in particular.

(Note that we still check the SET clauses to some extent; the behavior
with !check_function_bodies is now approximately equivalent to what ALTER
DATABASE/ROLE have been doing for awhile with context-dependent GUCs.)

This problem can be demonstrated in all active branches, so back-patch
all the way.
2013-09-03 18:32:26 -04:00
Andrew Dunstan
7d0492f337 Fix relfrozenxid query in docs to include TOAST tables.
The original query ignored TOAST tables which could result in tables
needing a vacuum not being reported.

Backpatch to all live branches.
2013-09-02 14:36:24 -04:00
Fujii Masao
e73357c10b Fix inaccurate description of tablespace.
Currently we don't need to update the pg_tablespace catalog
after redefining the symbolic links to the tablespaces
because pg_tablespace.spclocation column was removed in
PostgreSQL 9.2.

Back patch to 9.2 where pg_tablespace.spclocation was removed.

Ian Barwick, with minor change by me.
2013-07-31 22:37:11 +09:00
Robert Haas
e8ceb47bd3 doc: Fix typos in conversion names.
David Christensen
2013-07-19 10:54:18 -04:00
Stephen Frost
cce5d681be Use correct parameter name for view_option_value
The documentation for ALTER VIEW had a minor copy-and-paste error in
defining the parameters.  Noticed when reviewing the WITH CHECK OPTION
patch.

Backpatch to 9.2 where this was first introduced.
2013-07-17 10:53:38 -04:00
Michael Meskes
129e9dd1a2 Fixed incorrect description of EXEC SQL VAR command.
Thanks to MauMau <maumau307@gmail.com> for finding and fixing this.
2013-07-12 15:03:40 +02:00
Bruce Momjian
921a0b2013 pg_upgrade: document possible pg_hba.conf options
Previously, pg_upgrade docs recommended using .pgpass if using MD5
authentication to avoid being prompted for a password.  Turns out pg_ctl
never prompts for a password, so MD5 requires .pgpass --- document that.
Also recommend 'peer' for authentication too.
Backpatch back to 9.1.
2013-07-11 09:43:17 -04:00
Magnus Hagander
8a7de29002 Remove stray | character
Erikjan Rijkers
2013-07-05 16:21:38 +02:00
Bruce Momjian
74414bbd90 pg_buffercache: document column meanings
Improve documentation for usagecount and relforknumber.
Backpatch to 9.3.
Suggestion from Satoshi Nagayasu
2013-07-03 14:19:43 -04:00
Alvaro Herrera
ca871e71e6 Mention extra_float_digits in floating point docs
Make it easier for readers of the FP docs to find out about possibly
truncated values.

Per complaint from Tom Duffey in message
F0E0F874-C86F-48D1-AA2A-0C5365BF5118@trillitech.com

Author: Albe Laurenz
Reviewed by: Abhijit Menon-Sen
2013-07-02 13:14:02 -04:00
Tom Lane
60d7edb835 Tweak wording in sequence-function docs to avoid PDF build failures.
Adjust the wording in the first para of "Sequence Manipulation Functions"
so that neither of the link phrases in it break across line boundaries,
in either A4- or US-page-size PDF output.  This fixes a reported build
failure for the 9.3beta2 A4 PDF docs, and future-proofs this particular
para against causing similar problems in future.  (Perhaps somebody will
fix this issue in the SGML/TeX documentation tool chain someday, but I'm
not holding my breath.)

Back-patch to all supported branches, since the same problem could rise up
to bite us in future updates if anyone changes anything earlier than this
in func.sgml.
2013-06-27 00:24:07 -04:00
Noah Misch
1f3fbced65 Document effect of constant folding on CASE.
Back-patch to all supported versions.

Laurenz Albe
2013-06-26 20:33:40 -04:00
Peter Eisentraut
73c103dfa7 Further update CREATE FUNCTION documentation about argument names
More languages than SQL and PL/pgSQL actually support parameter names.
2013-06-19 22:29:34 -04:00
Simon Riggs
20a562f917 Fix docs on lock level for ALTER TABLE VALIDATE
ALTER TABLE .. VALIDATE CONSTRAINT previously
gave incorrect details about lock levels and
therefore incomplete reasons to use the option.

Initial bug report and fix from Marko Tiikkaja
Reworded by me to include comments by Kevin Grittner
2013-06-18 12:00:32 +01:00
Robert Haas
40baa43588 Improve description of loread/lowrite.
Patch by me, reviewed by Tatsuo Ishii.
2013-06-12 12:21:46 -04:00
Tatsuo Ishii
c571b5168e Add description that loread()/lowrite() are corresponding to
lo_read()/lo_write() in libpq to avoid confusion.
2013-06-11 14:28:53 +09:00
Tom Lane
5f4a311686 Remove ALTER DEFAULT PRIVILEGES' requirement of schema CREATE permissions.
Per discussion, this restriction isn't needed for any real security reason,
and it seems to confuse people more often than it helps them.  It could
also result in some database states being unrestorable.  So just drop it.

Back-patch to 9.0, where ALTER DEFAULT PRIVILEGES was introduced.
2013-06-09 15:26:48 -04:00
Kevin Grittner
cd4fe9514f Correct the documentation of pg_rewrite.ev_attr.
It claimed the value was always zero; it is really always -1.

Per report from Hari Babu

backpatch 734fbbd1d2d1babfbd195414e2445024ad549ae3 to 8.4
2013-06-07 09:23:01 -05:00
Tom Lane
58855fbf10 Minor docs wordsmithing.
Swap the order of a couple of phrases to clarify what the adjective
"subsequent" applies to.

Joshua Tolley
2013-06-07 00:08:28 -04:00
Bruce Momjian
6ab834fde7 pg_upgrade: document that --link should be used with --check
Backpatch to 9.2.
2013-06-06 10:13:54 -04:00
Peter Eisentraut
75b161d015 doc: Add IDs to link targets used by phpPgAdmin
Karl O. Pinc
2013-06-04 23:11:30 -04:00
Robert Haas
47ebaba6b4 Document auto_explain.log_timing.
Tomas Vondra
2013-05-29 07:39:17 -04:00
Stephen Frost
02230d3cd0 Documentation fix for ALTER TYPE .. RENAME
The documentation for ALTER TYPE .. RENAME claimed to support a
RESTRICT/CASCADE option at the 'type' level, which wasn't implemented
and doesn't make a whole lot of sense to begin with.  What is supported,
and previously undocumented, is

ALTER TYPE .. RENAME ATTRIBUTE .. RESTRICT/CASCADE.

I've updated the documentation and back-patched this to 9.1 where it was
first introduced.
2013-05-27 11:18:29 -04:00
Tom Lane
4a3613f930 Update CREATE FUNCTION documentation about argument names.
The 9.2 patch that added argument name support in SQL-language functions
missed updating a parenthetical comment about that in the CREATE FUNCTION
reference page.  Noted by Erwin Brandstetter.
2013-05-11 12:08:14 -04:00