1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-01 01:04:50 +03:00

9101 Commits

Author SHA1 Message Date
Peter Eisentraut
af09efda12 doc: Fix broken links to DocBook wiki 2012-12-01 01:53:02 -05:00
Tom Lane
94c014b532 Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY.
Commit 8cb53654dbdb4c386369eb988062d0bbb6de725e, which introduced DROP
INDEX CONCURRENTLY, managed to break CREATE INDEX CONCURRENTLY via a poor
choice of catalog state representation.  The pg_index state for an index
that's reached the final pre-drop stage was the same as the state for an
index just created by CREATE INDEX CONCURRENTLY.  This meant that the
(necessary) change to make RelationGetIndexList ignore about-to-die indexes
also made it ignore freshly-created indexes; which is catastrophic because
the latter do need to be considered in HOT-safety decisions.  Failure to
do so leads to incorrect index entries and subsequently wrong results from
queries depending on the concurrently-created index.

To fix, make the final state be indisvalid = true and indisready = false,
which is otherwise nonsensical.  This is pretty ugly but we can't add
another column without forcing initdb, and it's too late for that in 9.2.
(There's a cleaner fix in HEAD.)

In addition, change CREATE/DROP INDEX CONCURRENTLY so that the pg_index
flag changes they make without exclusive lock on the index are made via
heap_inplace_update() rather than a normal transactional update.  The
latter is not very safe because moving the pg_index tuple could result in
concurrent SnapshotNow scans finding it twice or not at all, thus possibly
resulting in index corruption.  This is a pre-existing bug in CREATE INDEX
CONCURRENTLY, which was copied into the DROP code.

In addition, fix various places in the code that ought to check to make
sure that the indexes they are manipulating are valid and/or ready as
appropriate.  These represent bugs that have existed since 8.2, since
a failed CREATE INDEX CONCURRENTLY could leave a corrupt or invalid
index behind, and we ought not try to do anything that might fail with
such an index.

Also fix RelationReloadIndexInfo to ensure it copies all the pg_index
columns that are allowed to change after initial creation.  Previously we
could have been left with stale values of some fields in an index relcache
entry.  It's not clear whether this actually had any user-visible
consequences, but it's at least a bug waiting to happen.

In addition, do some code and docs review for DROP INDEX CONCURRENTLY;
some cosmetic code cleanup but mostly addition and revision of comments.

Portions of this need to be back-patched even further, but I'll work
on that separately.

Problem reported by Amit Kapila, diagnosis by Pavan Deolasee,
fix by Tom Lane and Andres Freund.
2012-11-29 10:37:13 -05:00
Tom Lane
786afc1ce5 Revert patch for taking fewer snapshots.
This reverts commit d573e239f03506920938bf0be56c868d9c3416da, "Take fewer
snapshots".  While that seemed like a good idea at the time, it caused
execution to use a snapshot that had been acquired before locking any of
the tables mentioned in the query.  This created user-visible anomalies
that were not present in any prior release of Postgres, as reported by
Tomas Vondra.  While this whole area could do with a redesign (since there
are related cases that have anomalies anyway), it doesn't seem likely that
any future patch would be reasonably back-patchable; and we don't want 9.2
to exhibit a behavior that's subtly unlike either past or future releases.
Hence, revert to prior code while we rethink the problem.
2012-11-26 15:55:51 -05:00
Peter Eisentraut
9b06d91ac8 XSLT stylesheet: Add slash to directory name
Some versions of the XSLT stylesheets don't handle the missing slash
correctly (they concatenate directory and file name without the slash).
This might never have worked correctly.
2012-11-08 23:58:05 -05:00
Bruce Momjian
663c68f0e9 In pg_upgrade docs, mention using base backup as part of rsync for
logical replication upgrades.

Backpatch to 9.2.
2012-11-07 13:36:08 -05:00
Tom Lane
ec397c9099 Document that TCP keepalive settings read as 0 on Unix-socket connections.
Per bug #7631 from Rob Johnson.  The code is operating as designed, but the
docs didn't explain it.
2012-10-31 14:26:33 -04:00
Tom Lane
725fa25e20 In pg_dump, dump SEQUENCE SET items in the data not pre-data section.
Represent a sequence's current value as a separate TableDataInfo dumpable
object, so that it can be dumped within the data section of the archive
rather than in pre-data.  This fixes an undesirable inconsistency between
the meanings of "--data-only" and "--section=data", and also fixes dumping
of sequences that are marked as extension configuration tables, as per a
report from Marko Kreen back in July.  The main cost is that we do one more
SQL query per sequence, but that's probably not very meaningful in most
databases.

Back-patch to 9.1, since it has the extension configuration issue even
though not the --section switch.
2012-10-26 12:12:48 -04:00
Tom Lane
a4ef1f09bd Fix pg_dump's handling of DROP DATABASE commands in --clean mode.
In commit 4317e0246c645f60c39e6572644cff1cb03b4c65, I accidentally broke
this behavior while rearranging code to ensure that --create wouldn't
affect whether a DATABASE entry gets put into archive-format output.
Thus, 9.2 would issue a DROP DATABASE command in --clean mode, which is
either useless or dangerous depending on the usage scenario.
It should not do that, and no longer does.

A bright spot is that this refactoring makes it easy to allow the
combination of --clean and --create to work sensibly, ie, emit DROP
DATABASE then CREATE DATABASE before reconnecting.  Ordinarily we'd
consider that a feature addition and not back-patch it, but it seems
silly to not include the extra couple of lines required in the 9.2
version of the code.

Per report from Guillaume Lelarge, though this is slightly more extensive
than his proposed patch.
2012-10-20 16:58:42 -04:00
Simon Riggs
4be1d015b8 Fix typo in previous commit 2012-10-17 09:19:24 +01:00
Simon Riggs
679f2ca25b Clarify hash index caution and copy to CREATE INDEX docs 2012-10-17 08:23:05 +01:00
Tom Lane
812d6db943 Update obsolete text in fdwhandler.sgml.
Etsuro Fujita, with some wording adjustment by me.
2012-10-10 13:55:41 -04:00
Michael Meskes
6dea5f4c4e Removed sentence about not being able to retrieve more than one row at a time,
because it is not correct.
2012-10-05 17:07:38 +02:00
Tom Lane
cb4083dfbb Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs.
These reference pages still claimed that you have to be superuser to create
a database or schema owned by a different role.  That was true before 8.1,
but it was changed in commits aa1110624c08298393dfce996f7b21809d98d3fd and
f91370cd2faf1fd35a1ac74d84652a85ed841919 to allow assignment of ownership
to any role you are a member of.  However, at the time we were thinking of
that primarily as a change to the ALTER OWNER rules, so the need to touch
these two CREATE ref pages got missed.
2012-10-04 13:41:05 -04:00
Tom Lane
900d77fa57 Fix tar files emitted by pg_basebackup to be POSIX conformant.
Back-patch portions of commit 05b555d12bc2ad0d581f48a12b45174db41dc10d.
There doesn't seem to be any reason not to fix pg_basebackup fully, but
we can't change pg_dump's "magic" string without breaking older versions
of pg_restore.  Instead, just patch pg_restore to accept either version
of the magic string, in hopes of avoiding compatibility problems when
9.3 comes out.  I also fixed pg_dump to write the correct 2-block EOF
marker, since that won't create a compatibility problem with pg_restore
and it could help with some versions of tar.

Brian Weaver and Tom Lane
2012-09-28 15:35:46 -04:00
Tom Lane
f7b836eb83 Fix examples of how to use "su" while starting the server.
The syntax "su -c 'command' username" is not accepted by all versions of
su, for example not OpenBSD's.  More portable is "su username -c
'command'".  So change runtime.sgml to recommend that syntax.  Also,
add a -D switch to the OpenBSD example script, for consistency with other
examples.  Per Denis Lapshin and Gábor Hidvégi.
2012-09-25 13:52:57 -04:00
Tom Lane
cf17a4e854 Update release notes for 9.2.1, 9.1.6, 9.0.10, 8.4.14, 8.3.21. 2012-09-19 17:39:39 -04:00
Tom Lane
634d80ab2a Provide adequate documentation of the "table_name *" notation.
Somewhere along the line, somebody decided to remove all trace of this
notation from the documentation text.  It was still in the command syntax
synopses, or at least some of them, but with no indication what it meant.
This will not do, as evidenced by the confusion apparent in bug #7543;
even if the notation is now unnecessary, people will find it in legacy
SQL code and need to know what it does.
2012-09-17 14:59:35 -04:00
Kevin Grittner
fa41f294f6 Fix documentation reference to maximum allowed for autovacuum_freeze_max_age.
The documentation mentioned setting autovacuum_freeze_max_age to
"its maximum allowed value of a little less than two billion".
This led to a post asking about the exact maximum allowed value,
which is precisely two billion, not "a little less".

Based on question by Radovan Jablonovsky.  Backpatch to 8.3.
2012-09-16 12:19:37 -05:00
Andrew Dunstan
1bfd760c4f Fix catalog docs to reflect connoinherit change in 09ff76f.
Backpatch to 9.2.
2012-09-12 14:28:10 -04:00
Kevin Grittner
8a93fb0a85 Fix typo: lexemes misspelled in full text search docs.
Dan Scott

Backpatch original commit 4bc0d2e2cfa8ac523524dccf6f849989c6739083
to 9.1
2012-09-12 07:39:07 -05:00
Tom Lane
6acf90bc6e Fix typo in information_schema documentation.
Shigeru Hanada
2012-09-05 23:37:45 -04:00
Tom Lane
8a66a37d6d Make one last copy-editing pass over the 9.2 release notes.
Also, set the release date to 2012-09-10, since we're pretty well
committed to that now.
2012-09-05 21:28:27 -04:00
Bruce Momjian
469530b370 Document that pg_upgrade requires PGHOST be set for any pre-9.1 servers
with a socket directory mismatch with the new server.

Backpatch to 9.2.
2012-09-04 09:17:28 -04:00
Magnus Hagander
ee7a48c5b3 Mention basebackup-from-slave next to cascading replication 2012-09-04 14:37:51 +02:00
Tom Lane
5c7e91e9c3 Back-patch recent pg_upgrade fixes into 9.2.
This syncs contrib/pg_upgrade in the 9.2 branch with HEAD, except for the
HEAD changes related to converting XLogRecPtr to 64-bit int.  It includes
back-patching these commits:

666d494d19dbd5dc7a177709a2f7069913f8ab89
pg_upgrade: abstract out copying of files from old cluster to new
7afa8bed65ea925208f128048f3a528a64e1319a
pg_upgrade: Run the created scripts in the test suite
ab577e63faf792593ca728625a8ef0b1dfaf7500
Remove analyze_new_cluster.sh on make clean, too
34c02044ed7e7defde5a853b26dcd806c872d974
Fix thinko in comment
088c065ce8e405fafbfa966937184ece9defcf20
pg_upgrade: Fix exec_prog API to be less flaky
f763b77193b04eba03a1f4ce46df34dc0348419e
Fix pg_upgrade to cope with non-default unix_socket_directory scenarios.
2012-09-03 15:03:08 -04:00
Robert Haas
d561fc5396 Fix checkpoint_timeout documentation to reflect current behavior.
Jeff Janes
2012-08-30 15:08:53 -04:00
Robert Haas
36bffe4ffa Document how to prevent PostgreSQL itself from exhausting memory.
The existing documentation in Linux Memory Overcommit seemed to
assume that PostgreSQL itself could never be the problem, or at
least it didn't tell you what to do about it.

Per discussion with Craig Ringer and Kevin Grittner.
2012-08-30 14:23:19 -04:00
Tom Lane
a63b7744fa Improve a couple of 9.2 release note entries.
Clarify the compatibility notes about EXTRACT() and about statistics
timing columns.
2012-08-27 20:54:00 -04:00
Tom Lane
60888e232f Add section IDs to subsections of syntax.sgml that lacked them.
This is so that these sections will have stable HTML tags that one can
link to, rather than things like "AEN1902".  Perhaps we should mount a
campaign to do this everywhere, but I've found myself pointing at
syntax.sgml subsections often enough to be sure it's useful here.
2012-08-27 20:17:16 -04:00
Peter Eisentraut
019498f0c8 Some spelling adjustments in release notes 2012-08-24 22:37:30 -04:00
Peter Eisentraut
2e435eb38a Normalize some British spellings 2012-08-24 22:35:53 -04:00
Peter Eisentraut
5171a400cb Put options on man page and in help output in slightly better order 2012-08-24 00:07:44 -04:00
Heikki Linnakangas
ebcc0158f1 Fix typo in example. 2012-08-23 11:59:30 +03:00
Tom Lane
ead31d1a72 Remove overly-pessimistic statement about constraint exclusion.
As of 9.2, constraint exclusion should work okay with prepared statements:
the planner will try custom plans with actual values of the parameters,
and observe that they are a lot cheaper than the generic plan, and thus
never fall back to using the generic plan.  Noted by Tatsuhito Kasahara.
2012-08-22 23:55:57 -04:00
Tom Lane
d333773127 Make a cut at a major-features list for 9.2.
This is open to debate of course, but it's past time we had *something*
here.
2012-08-22 17:58:17 -04:00
Tom Lane
a902d46475 Make an editorial pass over the 9.2 release notes.
A very large number of small improvements ...
2012-08-22 17:37:13 -04:00
Tom Lane
9e8f8ef1f0 Fix erroneous documentation of synchronous_commit = remote_write.
The docs claimed that this mode only waits for the standby to receive WAL
data, but actually it waits for the data to be written out to the standby's
OS; which is a pretty significant difference because it removes the risk of
crash of the walreceiver process.
2012-08-22 14:04:49 -04:00
Tom Lane
3f9abab590 Update 9.2 release notes to reflect commits to date.
I was unable to entirely resist the temptation to copy-edit related
entries, but will save most of that for a separate pass.
2012-08-21 22:57:45 -04:00
Tom Lane
333a54a584 Update release notes for 9.1.5, 9.0.9, 8.4.13, 8.3.20. 2012-08-14 18:34:02 -04:00
Tom Lane
2ec75967d9 Prevent access to external files/URLs via contrib/xml2's xslt_process().
libxslt offers the ability to read and write both files and URLs through
stylesheet commands, thus allowing unprivileged database users to both read
and write data with the privileges of the database server.  Disable that
through proper use of libxslt's security options.

Also, remove xslt_process()'s ability to fetch documents and stylesheets
from external files/URLs.  While this was a documented "feature", it was
long regarded as a terrible idea.  The fix for CVE-2012-3489 broke that
capability, and rather than expend effort on trying to fix it, we're just
going to summarily remove it.

While the ability to write as well as read makes this security hole
considerably worse than CVE-2012-3489, the problem is mitigated by the fact
that xslt_process() is not available unless contrib/xml2 is installed,
and the longstanding warnings about security risks from that should have
discouraged prudent DBAs from installing it in security-exposed databases.

Reported and fixed by Peter Eisentraut.

Security: CVE-2012-3488
2012-08-14 18:31:43 -04:00
Bruce Momjian
30f891151e In documentation, change "recommendable" to "recommended", per
consultation with word definitions.

Backpatch to 9.2.
2012-08-14 12:36:46 -04:00
Tom Lane
ce36ecda51 Add link from COPY ref page to psql \copy.
Jeff Janes
2012-08-11 13:51:40 -04:00
Magnus Hagander
63e719ec51 Fix upper limit of superuser_reserved_connections, add limit for wal_senders
Should be limited to the maximum number of connections excluding
autovacuum workers, not including.

Add similar check for max_wal_senders, which should never be higher than
max_connections.
2012-08-10 14:51:57 +02:00
Simon Riggs
cc23119af5 Doc correction to point out that 9.2+ can overwrite pg_xlog files.
Noted by Noah Misch, patch by Fujii Masao
2012-08-08 22:36:55 +01:00
Robert Haas
73a7a6460e Typo fixes for previous commit.
Noted by Thom Brown.
2012-08-06 16:12:35 -04:00
Robert Haas
e022ed91d7 Warn more vigorously about the non-transactional behavior of sequences.
Craig Ringer, edited fairly heavily by me
2012-08-06 15:19:26 -04:00
Bruce Momjian
a411f7e770 Reword documentation for concurrent index rebuilds to be clearer.
Backpatch to 9.1 and 9.2.
2012-08-04 10:35:46 -04:00
Bruce Momjian
bf92fb6c2d Add link to synchronous_commit variables in high availability docs.
Backpatch to 9.2

Erik Rijkers
2012-08-03 16:33:18 -04:00
Bruce Momjian
e7d9f26a60 Document that trying to exceed temp_file_limit causes a query cancel.
Backpatch to 9.2.
2012-08-03 15:15:27 -04:00
Bruce Momjian
91668fcc31 Document that, for psql -c, only the result of the last command is
returned, per report from Aleksey Tsalolikhin

Backpatch to 9.2 and 9.1.
2012-08-03 14:02:22 -04:00