aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Prevent pg_basebackup when integer_datetimes flag doesn't match.Robert Haas2012-05-22
| | | | | Magnus Hagander, reviewed by Fujii Masao, with slight wording changes by me.
* Repair out-of-date information in src/backend/storage/buffer/README.Robert Haas2012-05-22
| | | | | | | | In commit d526575f893c1a4e05ebd307e80203536b213a6d, 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.
* Move postmaster's RemovePgTempFiles call to a less randomly chosen place.Tom Lane2012-05-21
| | | | | | | | | | | | | | | | | | 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.
* Update woefully-obsolete comment.Tom Lane2012-05-21
| | | | | | 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.
* pg_ctl: Sort signal list in --help outputPeter Eisentraut2012-05-21
| | | | | The list was neither logical nor numerical nor alphabetical. Let's go with alphabetical.
* libpq: Add missing file to GETTEXT_FILES listPeter Eisentraut2012-05-21
| | | | | | 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.
* Fix incorrect logic in JSON number lexerPeter Eisentraut2012-05-20
| | | | | | | Detectable by gcc -Wlogical-op. Add two regression test cases that would previously allow incorrect values to pass.
* Realign some --help output to have better spacing between columnsPeter Eisentraut2012-05-18
|
* Fix bug in gistRelocateBuildBuffersOnSplit().Heikki Linnakangas2012-05-18
| | | | | | | | | | | | | | | | | | | 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.
* Update SQL features/conformance information to SQL:2011Peter Eisentraut2012-05-17
|
* Change COLLATION keyword categoryPeter Eisentraut2012-05-16
| | | | | | It was changed from unreserved to reserved as part of the COLLATION FOR syntax, but it turns out that type_func_name_keyword is sufficient.
* Improve error message for ALTER COLUMN TYPE coercion failure.Tom Lane2012-05-16
| | | | | | | Per recent discussion, the error message for this was actually a trifle inaccurate, since it said "cannot be cast" which might be incorrect. Adjust that wording, and add a HINT suggesting that a USING clause might be needed.
* Fix bug in freespace calculation in heap_multi_insert().Heikki Linnakangas2012-05-16
| | | | | | | If the amount of freespace on page was less than the amount reserved by fillfactor, the calculation would underflow. This fixes bug #6643 reported by Tomonari Katsumata.
* Remove whitespace from end of linesPeter Eisentraut2012-05-15
| | | | pgindent and perltidy should clean up the rest.
* Remove stray nbsp characterPeter Eisentraut2012-05-15
|
* Fix bug in to_tsquery().Heikki Linnakangas2012-05-15
| | | | | We were using memcpy() to copy to a possibly overlapping memory region, which is a no-no. Use memmove() instead.
* In pgstat.c, use a timeout in WaitLatchOrSocket only on Windows.Tom Lane2012-05-14
| | | | | | | We have no need for a timeout here really, but some broken products from Redmond seem to lose FD_READ events occasionally, and waking up and retrying the recv() is the only known way to work around that. Perhaps somebody will be motivated to figure out a better answer here; but not I.
* Revert "Add some temporary instrumentation to pgstat.c."Tom Lane2012-05-14
| | | | | This reverts commit 7d88bb73f755f7fb5d847ef2319c21076054fb0e. That instrumentation has served its purpose.
* Put back AC_REQUIRE([AC_STRUCT_TM]).Tom Lane2012-05-14
| | | | | | The BSD-ish members of the buildfarm all seem to think removing this was a bad idea. It looks to me like it resulted in omitting the system header inclusion necessary to detect the fields of struct tm correctly.
* Assert that WaitLatchOrSocket callers cannot wait only for writability.Tom Lane2012-05-14
| | | | | | | | | | | | | Since we have chosen to report socket EOF and error conditions via the WL_SOCKET_READABLE flag bit, it's unsafe to wait only for WL_SOCKET_WRITEABLE; the caller would never be notified of the socket condition, and in some of these implementations WaitLatchOrSocket would busy-wait until something else happens. Add this restriction to the API specification, and add Asserts to check that callers don't try to do that. At some point we might want to consider adjusting the API to relax this restriction, but until we have an actual use case for waiting on a write-only socket, it seems premature to design a solution.
* Remove unused AC_DEFINE symbolsPeter Eisentraut2012-05-14
| | | | | | | | | ENABLE_DTRACE unused as of a7b7b07af340c73adee9959edf260695591a9496 HAVE_ERR_SET_MARK unused as of 4ed4b6c54e5fab24ab2624d80e26f7546edc88ad HAVE_FCVT unused as of 4553e1d80f824291932cfde30aa24a76dd8f1941 HAVE_STRUCT_SOCKADDR_UN unused as of b4cea00a1fc9d2270bfe9aeeee44915378d5f733 HAVE_SYSCONF unused as of f83356c7f574bc69969f29dc7b430b286a0cd9f4 TM_IN_SYS_TIME never used, obsolescent per Autoconf documentation
* For testing purposes, reinsert a timeout in pgstat.c's wait call.Tom Lane2012-05-14
| | | | | | | | | | Test results from buildfarm members mastodon/narwhal (Windows Server 2003) make it look like that platform just plain loses FD_READ events occasionally, and the only reason our previous coding seemed to work was that it timed out every couple of seconds and retried the whole operation. Try to verify this by reinserting a finite timeout into the pgstat loop. This isn't meant to be a permanent patch either, just to confirm or disprove a theory.
* Force pgwin32_recv into nonblock mode when called from pgstat.c.Tom Lane2012-05-14
| | | | | | | | This should get rid of the usage of pgwin32_waitforsinglesocket entirely, and perhaps thereby remove the race condition that's evidently still present on some versions of Windows. The previous arrangement was a bit unsafe anyway, since waiting at the recv() would not allow pgstat to notice postmaster death.
* Remove unnecessary pg_verifymbstr() calls from tsvector/query in functions.Heikki Linnakangas2012-05-14
| | | | | The input should've been validated well before it hits the input function. Doing so again is a waste of cycles.
* Update comments that became out-of-date with the PGXACT struct.Heikki Linnakangas2012-05-14
| | | | | | | | | | | When the "hot" members of PGPROC were split off to separate PGXACT structs, many PGPROC fields referred to in comments were moved to PGXACT, but the comments were neglected in the commit. Mostly this is just a search/replace of PGPROC with PGXACT, but the way the dummy PGPROC entries are created for prepared transactions changed more, making some of the comments totally bogus. Noah Misch
* Remove leftovers of BeOS portPeter Eisentraut2012-05-14
| | | | | These should have been removed when the BeOS port was removed in 44f90212236bfb6fc1279e95dc8fa315104d964e.
* Small punctuation editing of postgresql.conf.samplePeter Eisentraut2012-05-14
|
* pg_ctl: Improve --help outputPeter Eisentraut2012-05-14
| | | | | All other --help output has = signs between long options and their arguments, so do it here as well.
* Add some temporary instrumentation to pgstat.c.Tom Lane2012-05-13
| | | | | | | | Log main-loop blocking events and the results of inquiry messages. This is to get some clarity as to what's happening on those Windows buildfarm members that still don't like the latch-ified stats collector. This bulks up the postmaster log a tad, so I won't leave it in place for long.
* Fix DROP TABLESPACE to unlink symlink when directory is not there.Tom Lane2012-05-13
| | | | | | | | | | | | | | | | | | | | | If the tablespace directory is missing entirely, we allow DROP TABLESPACE to go through, on the grounds that it should be possible to clean up the catalog entry in such a situation. However, we forgot that the pg_tblspc symlink might still be there. We should try to remove the symlink too (but not fail if it's no longer there), since not doing so can lead to weird behavior subsequently, as per report from Michael Nolan. There was some discussion of adding dependency links to prevent DROP TABLESPACE when the catalogs still contain references to the tablespace. That might be worth doing too, but it's an orthogonal question, and in any case wouldn't be back-patchable. Back-patch to 9.0, which is as far back as the logic looks like this. We could possibly do something similar in 8.x, but given the lack of reports I'm not sure it's worth the trouble, and anyway the case could not arise in the form the logic is meant to cover (namely, a post-DROP transaction rollback having resurrected the pg_tablespace entry after some or all of the filesystem infrastructure is gone).
* Re-revert stats collector latch changes.Tom Lane2012-05-13
| | | | | | This reverts commit cb2f2873d6b81ad7f0a9733ba738bfac0746fb7b, restoring the latch-ified stats collector logic. We'll soon see if this works any better on the Windows buildfarm machines.
* Attempt to fix some issues in our Windows socket code.Tom Lane2012-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure WaitLatchOrSocket regards FD_CLOSE as a read-ready condition. We might want to tweak this further, but it was surely wrong as-is. Make pgwin32_waitforsinglesocket detach its private event object from the passed socket before returning. I suspect that failure to do so leads to race conditions when other code (such as WaitLatchOrSocket) attaches a different event object to the same socket. Moreover, the existing coding meant that repeated calls to pgwin32_waitforsinglesocket would perform ResetEvent on an event actively connected to a socket, which is rumored to be an unsafe practice; the WSAEventSelect documentation appears to recommend against this, though it does not say not to do it in so many words. Also, uniformly use the coding pattern "WSAEventSelect(s, NULL, 0)" to detach events from sockets, rather than passing the event in the second parameter. The WSAEventSelect documentation says that the second parameter is ignored if the third is 0, so theoretically this should make no difference. However, elsewhere on the same reference page the use of NULL in this context is recommended, and I have found suggestions on the net that some versions of Windows have bugs with a non-NULL second parameter in this usage. Some other mostly-cosmetic cleanup, such as using the right one of WSAGetLastError and GetLastError for reporting errors from these functions.
* Fix bogus declaration of local variable.Tom Lane2012-05-13
| | | | | | rc should be an int here, not a pgsocket. Fairly harmless as long as pgsocket is an integer type, but nonetheless wrong. Error introduced in commit 87091cb1f1ed914e2ddca424fa28f94fdf8461d2.
* Avoid unnecessary process wakeups in the log collector.Tom Lane2012-05-12
| | | | | | | | syslogger was coded to wake up once per second whether there was anything useful to do or not. As part of our campaign to reduce the server's idle power consumption, change it to use a latch for waiting. Now, in the absence of any data to log or any signals to service, it will only wake up at the programmed logfile rotation times (if any).
* Fix WaitLatchOrSocket to handle EOF on socket correctly.Tom Lane2012-05-12
| | | | | | | | | | When using poll(), EOF on a socket is reported with the POLLHUP not POLLIN flag (at least on Linux). WaitLatchOrSocket failed to check this bit, causing it to go into a busy-wait loop if EOF occurs. We earlier fixed the same mistake in the test for the state of the postmaster_alive socket, but missed it for the caller-supplied socket. Fortunately, this error is new in 9.2, since 9.1 only had a select() based code path not a poll() based one.
* Ensure backwards compatibility for GetStableLatestTransactionId()Simon Riggs2012-05-12
|
* Fix obsolescent C declaration syntaxPeter Eisentraut2012-05-12
| | | | | gcc -Wextra/-Wold-style-declaration thinks that "inline" should go before the function return type.
* Cosmetic adjustments for postmaster's handling of checkpointer.Tom Lane2012-05-11
| | | | | Correct some comments, order some operations a bit more consistently. No functional changes.
* PL/Python: Adjust the regression tests for Python 3.3Peter Eisentraut2012-05-11
| | | | | | | | | The string representation of ImportError changed. Remove printing that; it's not necessary for the test. The order in which members of a dict are printed changed. But this was always implementation-dependent, so we have just been lucky for a long time. Do the printing the hard way to ensure sorted order.
* Prevent loss of init fork when truncating an unlogged table.Robert Haas2012-05-11
| | | | Fixes bug #6635, reported by Akira Kurosawa.
* Remove extraneous #include "storage/proc.h"Simon Riggs2012-05-11
|
* Ensure age() returns a stable value rather than the latest valueSimon Riggs2012-05-11
|
* On GiST page split, release the locks on child pages before recursing up.Heikki Linnakangas2012-05-11
| | | | | | | | | | | | | | | | | | When inserting the downlinks for a split gist page, we used hold the locks on the child pages until the insertion into the parent - and recursively its parent if it had to be split too - were all completed. Change that so that the locks on child pages are released after the insertion in the immediate parent is done, before recursing further up the tree. This reduces the number of lwlocks that are held simultaneously. Holding many locks is bad for concurrency, and in extreme cases you can even hit the limit of 100 simultaneously held lwlocks in a backend. If you're really unlucky, you can hit the limit while in a critical section, which brings down the whole system. This fixes bug #6629 reported by Tom Forbes. Backpatch to 9.1. The page splitting code was rewritten in 9.1, and the old code did not have this problem.
* Revert catalog bump; was post-beta1, and unnecessary.Bruce Momjian2012-05-10
|
* Update comment for 'name' data type to say 63 "bytes".Bruce Momjian2012-05-10
| | | | Catalog version bump so everyone has the same comment for beta1.
* Stamp 9.2beta1.REL9_2_BETA1Tom Lane2012-05-10
|
* Temporarily revert stats collector latch changes so we can ship beta1.Tom Lane2012-05-10
| | | | | | | | | This patch reverts commit 49340037ee3ab46cb24144a86705e35f272c24d5 and some follow-on tweaking in pgstat.c. While the basic scheme of latch-ifying the stats collector seems sound enough, it's failing on most Windows buildfarm members for unknown reasons, and there's no time left to debug that before 9.2beta1. Better to ship a beta version without this improvement. I hope to re-revert this once beta1 is out, though.
* Make WaitLatch's WL_POSTMASTER_DEATH result trustworthy; simplify callers.Tom Lane2012-05-10
| | | | | | | | Per a suggestion from Peter Geoghegan, make WaitLatch responsible for verifying that the WL_POSTMASTER_DEATH bit it returns is truthful (by testing PostmasterIsAlive). Then simplify its callers, who no longer need to do that for themselves. Remove weasel wording about falsely-set result bits from WaitLatch's API contract.
* PL/Python: Fix slicing support for result objects for Python 3Peter Eisentraut2012-05-10
| | | | | | | | | | The old way of implementing slicing support by implementing PySequenceMethods.sq_slice no longer works in Python 3. You now have to implement PyMappingMethods.mp_subscript. Do this by simply proxying the call to the wrapped list of result dictionaries. Consolidate some of the subscripting regression tests. Jan Urbański
* PL/Python: Update incorrect commentPeter Eisentraut2012-05-10
| | | | Jan Urbański