Commit Graph

33683 Commits

Author SHA1 Message Date
Peter Eisentraut 27314d32a8 Suppress -Wunused-result warning about write()
This is related to aa90e148ca, but this
code is only used under -DLINUX_OOM_ADJ, so it was apparently
overlooked then.
2012-05-27 22:35:01 +03:00
Peter Eisentraut a8b92b6090 PL/Perl: Avoid compiler warning from clang
Use SvREFCNT_inc_simple_void() instead of SvREFCNT_inc() to avoid
warning about unused return value.
2012-05-27 22:30:34 +03:00
Bruce Momjian 4498a3407a Improve pg_upgrade C comment. 2012-05-27 06:45:29 -04:00
Bruce Momjian 20a3830b81 Add C comment explaining why we can't exclude checking functions in the
pg_catalog schema, even though they are not explicitly dumped (they are
implicitly dumped, e.g. create language plperl).
2012-05-27 06:35:10 -04:00
Bruce Momjian d4696fa68f Add pg_update C comment about problems with plpython_call_handler(). 2012-05-27 06:29:45 -04:00
Magnus Hagander 16282ae688 Make pg_recievexlog by default loop on connection failures
Avoids the need for an external script in the most common
scenario. Behavior can be overridden using the -n/--noloop
commandline parameter.
2012-05-27 11:05:24 +02:00
Magnus Hagander 2b97db61dd Fix handling of pg_stat_statements.stat temporary file
Write the file to a temporary name and then rename() it into the
permanent name, to ensure it can't end up half-written and corrupt
in case of a crash during shutdown.

Unlink the file after it has been read so it's removed from the data
directory and not included in base backups going to replication slaves.
2012-05-27 10:54:31 +02:00
Tom Lane 532fe28dad Prevent synchronized scanning when systable_beginscan chooses a heapscan.
The only interesting-for-performance case wherein we force heapscan here
is when we're rebuilding the relcache init file, and the only such case
that is likely to be examining a catalog big enough to be syncscanned is
RelationBuildTupleDesc.  But the early-exit optimization in that code gets
broken if we start the scan at a random place within the catalog, so that
allowing syncscan is actually a big deoptimization if pg_attribute is large
(at least for the normal case where the rows for core system catalogs have
never been changed since initdb).  Hence, prevent syncscan here.  Per my
testing pursuant to complaints from Jeff Frost and Greg Sabino Mullane,
though neither of them seem to have actually hit this specific problem.

Back-patch to 8.3, where syncscan was introduced.
2012-05-26 19:09:52 -04:00
Tom Lane d3b97d1488 Fix string truncation to be multibyte-aware in text_name and bpchar_name.
Previously, casts to name could generate invalidly-encoded results.

Also, make these functions match namein() more exactly, by consistently
using palloc0() instead of ad-hoc zeroing code.

Back-patch to all supported branches.

Karl Schnaitter and Tom Lane
2012-05-25 17:34:51 -04:00
Tom Lane 73cc7d3b24 Use binary search instead of brute-force scan in findNamespace().
The previous coding presented a significant bottleneck when dumping
databases containing many thousands of schemas, since the total time
spent searching would increase roughly as O(N^2) in the number of objects.
Noted by Jeff Janes, though I rewrote his proposed patch to use the
existing findObjectByOid infrastructure.

Since this is a longstanding performance bug, backpatch to all supported
versions.
2012-05-25 14:35:37 -04:00
Bruce Momjian 45ca31d6a7 Have pg_upgrade only use one extra log file for Win32, not two. 2012-05-25 09:10:07 -04:00
Magnus Hagander 31d965819b Fix base backup streaming xlog from standby
When backing up from a standby server, the backup process
will not automatically switch xlog segment. So we must
accept a partially transferred xlog file in this case, but
rename it into position anyway.

In passing, merge the two callbacks for segment end and
stop stream into a single callback, since their implementations
were close to identical, and rename this callback to
reflect that it stops streaming rather than continues it.

Patch by Magnus Hagander, review by Fujii Masao
2012-05-25 11:36:22 +02:00
Bruce Momjian d226e236c6 On Windows, have pg_upgrade use different two files to log pg_ctl
start/stop output, to fix file share error reported by Edmund Horner
2012-05-24 20:30:39 -04:00
Bruce Momjian 32cebaaed5 Clarify 9.2 release notes items about pg_stat_statements, to better
document fix of double counting and read/write count addition, per Peter
Geoghegan
2012-05-24 19:10:06 -04:00
Bruce Momjian 7672366a89 Change pg_stat_statements order of release note items, per Peter
Geoghegan
2012-05-24 17:51:56 -04:00
Bruce Momjian eeef7bd2da Remove PL/Perl null array 9.2 release note item, per Andrew Dunstan 2012-05-24 17:36:15 -04:00
Tom Lane 2a4c46e0ba Fix array overrun in regex code.
zaptreesubs() was coded to unconditionally reset a capture subre's
corresponding pmatch[] entry.  However, in regexes without backrefs, that
array is caller-supplied and might not have as many entries as the regex
has capturing parens.  So check the array length and do nothing if there
is no corresponding entry, much as subset() does.  Failure to check this
resulted in a stack clobber in the case reported by Marko Kreen.

This bug appears to have been latent in the regex library from the
beginning.  It was not exposed because find() called dissect() not
cdissect(), and the dissect() code path didn't ever call zaptreesubs()
(formerly zapmem()).  When I unified dissect() and cdissect() in commit
4dd78bf37a, the problem was exposed.

Now that I've seen this, I'm rather suspicious that we might need to
back-patch it; but will refrain for now, for lack of evidence that
the case can be hit in the previous coding.
2012-05-24 13:56:16 -04:00
Peter Eisentraut ace397e9d2 Update SQL key word list to SQL:2011
For space reasons, drop SQL:1999 and SQL:2003.  Only keep the latest
two and SQL-92 for historical comparison.
2012-05-24 20:06:25 +03:00
Bruce Momjian 476291bef0 Adjust pg_upgrade to output a separate log file for pg_ctl output on
Windows, to avoid opening a file by multiple processes.
2012-05-23 20:19:34 -04:00
Magnus Hagander 77f93cb32d Add missing PQfinish() calls
Fujii Masao
2012-05-23 21:52:23 +02:00
Peter Eisentraut 72155b29a8 pg_standby: Remove tabs from string literals
And align a bit better with the rest of the debug output.
2012-05-23 19:58:17 +03:00
Bruce Momjian db2cd07482 Mention Peter Geoghegan as primary author of pg_stat_statements changes. 2012-05-23 10:12:44 -04:00
Bruce Momjian 13477c0197 Improve wording of 9.2 clog release note item. 2012-05-23 09:29:39 -04:00
Bruce Momjian b9c895ee6f Add 9.2 release note authorship mentions for Heikki and Alexander
Korotkov, per Alexander Korotkov.
2012-05-22 22:59:31 -04:00
Tom Lane ed962fd712 Ensure that seqscans check for interrupts at least once per page.
If a seqscan encounters many consecutive pages containing only dead tuples,
it can remain in the loop in heapgettup for a long time, and there was no
CHECK_FOR_INTERRUPTS anywhere in that loop.  This meant there were
real-world situations where a query would be effectively uncancelable for
long stretches.  Add a check placed to occur once per page, which should be
enough to provide reasonable response time without adding any measurable
overhead.

Report and patch by Merlin Moncure (though I tweaked it a bit).
Back-patch to all supported branches.
2012-05-22 19:42:05 -04:00
Peter Eisentraut 92a953fbf8 Add small example about pg_archivecleanup -x option
Every time I read this I had doubts about whether the argument to the
-x option should include the dot (yes).  A small example should
clarify this.
2012-05-23 01:06:33 +03:00
Bruce Momjian 0013a665b7 Fix markup for HISTORY generation. 2012-05-22 17:36:33 -04:00
Bruce Momjian e6b7170c33 Fix reindexdb manual page to say --maintenance-db controls what is
reindexed, not vacuumed (typo).  Per report from Thomas REISS
2012-05-22 17:31:46 -04:00
Bruce Momjian 007522e6b4 9.2 release notes: GiST index improvements are for all geometric index
types, per Alexander Korotkov
2012-05-22 17:26:42 -04:00
Bruce Momjian 8a46e25189 Remove reviewers from 9.2 release notes; improve attributions. 2012-05-22 17:17:15 -04:00
Robert Haas 8fbe5a317d Fix error message for COMMENT/SECURITY LABEL ON COLUMN xxx IS 'yyy'
When the column name is an unqualified name, rather than table.column,
the error message complains about too many dotted names, which is
wrong.  Report by Peter Eisentraut based on examination of the
sepgsql regression test output, but the problem also affects COMMENT.
New wording as suggested by Tom Lane.
2012-05-22 11:23:36 -04:00
Robert Haas b536458e73 Release note improvements.
Document some more things as incompatibilities, and improve wording of
another item.

Noah Misch
2012-05-22 10:20:25 -04:00
Robert Haas 304aa339b2 Prevent pg_basebackup when integer_datetimes flag doesn't match.
Magnus Hagander, reviewed by Fujii Masao, with slight wording changes
by me.
2012-05-22 10:02:47 -04:00
Robert Haas 219c024c64 Repair out-of-date information in src/backend/storage/buffer/README.
In commit d526575f89, we changed things so
that buffer usage counts are incremented when the buffer is pinned, rather
than when it is unpinned, but the README file didn't get the memo.

Report by Amit Kapila.
2012-05-22 09:32:09 -04:00
Tom Lane b94ce6e807 Move postmaster's RemovePgTempFiles call to a less randomly chosen place.
There is no reason to do this as early as possible in postmaster startup,
and good reason not to do it until we have completely created the
postmaster's lock file, namely that it might contribute to pg_ctl thinking
that postmaster startup has timed out.  (This would require a rather
unusual amount of time to be spent scanning temp file directories, but we
have at least one field report of it happening reproducibly.)

Back-patch to 9.1.  Before that, pg_ctl didn't wait for additional info to
be added to the lock file, so it wasn't a problem.

Note that this is not a complete fix to the slow-start issue in 9.1,
because we still had identify_system_timezone being run during postmaster
start in 9.1.  But that's at least a reasonably well-defined delay, with
an easy workaround if needed, whereas the temp-files scan is not so
predictable and cannot be avoided.
2012-05-21 22:50:30 -04:00
Tom Lane efae4653c9 Update woefully-obsolete comment.
The accurate info about what's in a lock file has been in miscadmin.h
for some time, so let's just make this comment point there instead of
maintaining a duplicative copy.
2012-05-21 22:11:00 -04:00
Peter Eisentraut cdf8bcb8d9 pg_ctl: Sort signal list in --help output
The list was neither logical nor numerical nor alphabetical.  Let's go
with alphabetical.
2012-05-21 20:12:30 +03:00
Peter Eisentraut 4c39a09089 libpq: Add missing file to GETTEXT_FILES list
For the record, fe-print.c is also missing, but it's sort of
deprecated, and the string internationalization there has some issues,
and it doesn't seem worth fixing that.  So let's leave that out.
2012-05-21 20:08:50 +03:00
Tom Lane e79da56b85 Adjust documentation of ALTER TABLE CLUSTER ON for more consistency.
Josh Kupershmidt
2012-05-21 12:06:56 -04:00
Tom Lane 8be950f5c0 Document that we deviate from ISO 8601 by not using 'T' on output.
Per discussion, we should explain that we follow RFC 3339 and not really
the letter of the ISO 8601 spec for timestamp output format.  Mostly
Brendan Jurd's wording, though I tweaked it to clarify that we do take 'T'
on input.  Minor additional copy-editing and markup-tweaking, too.
2012-05-21 11:56:00 -04:00
Peter Eisentraut f1f6737e15 Fix incorrect logic in JSON number lexer
Detectable by gcc -Wlogical-op.

Add two regression test cases that would previously allow incorrect
values to pass.
2012-05-20 02:24:46 +03:00
Peter Eisentraut fe2534e534 Some reference page improvements
initdb: Add -T option
oid2name: Put options in some non-random order
pg_dump: Put --section option in the right place

And some additional markup and terminology improvements.
2012-05-20 01:15:55 +03:00
Peter Eisentraut 510860a6a5 Small cleanups of contrib --help output 2012-05-20 01:14:25 +03:00
Peter Eisentraut 9c64f39557 Put back word that was mysteriously lost in man page conversion 2012-05-19 20:36:09 +03:00
Michael Meskes c1ba858c6d Reworded sentence as suggested by Stephen Frost. 2012-05-19 14:44:56 +02:00
Peter Eisentraut 2273a50364 Realign some --help output to have better spacing between columns 2012-05-18 20:34:14 +03:00
Heikki Linnakangas 1d27dcf578 Fix bug in gistRelocateBuildBuffersOnSplit().
When we create a temporary copy of the old node buffer, in stack, we mustn't
leak that into any of the long-lived data structures. Before this patch,
when we called gistPopItupFromNodeBuffer(), it got added to the array of
"loaded buffers". After gistRelocateBuildBuffersOnSplit() exits, the
pointer added to the loaded buffers array points to garbage. Often that goes
unnotied, because when we go through the array of loaded buffers to unload
them, buffers with a NULL pageBuffer are ignored, which can often happen by
accident even if the pointer points to garbage.

This patch fixes that by marking the temporary copy in stack explicitly as
temporary, and refrain from adding buffers marked as temporary to the array
of loaded buffers.

While we're at it, initialize nodeBuffer->pageBlocknum to InvalidBlockNumber
and improve comments a bit. This isn't strictly necessary, but makes
debugging easier.
2012-05-18 19:38:32 +03:00
Peter Eisentraut 8402fab411 file_fdw: Improve error message
The hint looked a bit confusing when there were no valid options to
hint about.
2012-05-17 20:20:33 +03:00
Peter Eisentraut 4ad5cbedf6 Update key words table for 9.2 2012-05-17 19:27:55 +03:00
Peter Eisentraut 939ec9b8a4 Update SQL features/conformance information to SQL:2011 2012-05-17 09:50:04 +03:00