summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove files signaling a standby promotion request at postmaster startupFujii Masao2015-09-093-0/+32
| | | | | | | | | | | | | | | | | | | | | | This commit makes postmaster forcibly remove the files signaling a standby promotion request. Otherwise, the existence of those files can trigger a promotion too early, whether a user wants that or not. This removal of files is usually unnecessary because they can exist only during a few moments during a standby promotion. However there is a race condition: if pg_ctl promote is executed and creates the files during a promotion, the files can stay around even after the server is brought up to new master. Then, if new standby starts by using the backup taken from that master, the files can exist at the server startup and should be removed in order to avoid an unexpected promotion. Back-patch to 9.1 where promote signal file was introduced. Problem reported by Feike Steenbergen. Original patch by Michael Paquier, modified by me. Discussion: 20150528100705.4686.91426@wrigleys.postgresql.org
* Lock all relations referred to in updatable viewsStephen Frost2015-09-081-0/+15
| | | | | | | | | | Even views considered "simple" enough to be automatically updatable may have mulitple relations involved (eg: in a where clause). We need to make sure and lock those relations when rewriting the query. Back-patch to 9.3 where updatable views were added. Pointed out by Andres, patch thanks to Dean Rasheed.
* psql: Generic tab completion support for enum and bool GUCs.Andres Freund2015-09-081-35/+97
| | | | | | Author: Pavel Stehule Reviewed-By: Andres Freund Discussion: 5594FE7A.5050205@iki.fi
* Add gin_fuzzy_search_limit to postgresql.conf.sample.Fujii Masao2015-09-091-0/+1
| | | | | | | This was forgotten in 8a3631f (commit that originally added the parameter) and 0ca9907 (commit that added the documentation later that year). Back-patch to all supported versions.
* Improve tab-completion for GRANT and REVOKE.Fujii Masao2015-09-091-16/+106
| | | | Thomas Munro, reviewed by Michael Paquier, modified by me.
* Allow per-tablespace effective_io_concurrencyAlvaro Herrera2015-09-0812-63/+145
| | | | | | | | | | Per discussion, nowadays it is possible to have tablespaces that have wildly different I/O characteristics from others. Setting different effective_io_concurrency parameters for those has been measured to improve performance. Author: Julien Rouhaud Reviewed by: Andres Freund
* Fix error message wording in previous sslinfo commitAlvaro Herrera2015-09-081-7/+7
|
* contrib/sslinfo: add ssl_extension_info SRFAlvaro Herrera2015-09-076-9/+202
| | | | | | | | | | This new function provides information about SSL extensions present in the X509 certificate used for the current connection. Extension version updated to version 1.1. Author: Дмитрий Воронин (Dmitry Voronin) Reviewed by: Michael Paquier, Heikki Linnakangas, Álvaro Herrera
* In the pg_rewind test suite, receive WAL fully before promoting.Noah Misch2015-09-071-6/+8
| | | | | | | | | | If a transaction never reaches the standby, later tests find unexpected cluster state. A "tail-copy: query result matches" test failure has been the usual symptom. Among the buildfarm members having run this test suite, most have exhibited that symptom at least once. Back-patch to 9.5, where pg_rewind was introduced. Michael Paquier, reported by Christoph Berg.
* Coordinate log_line_prefix options 'm' and 'n' to share a timeval.Jeff Davis2015-09-071-9/+23
| | | | | | | | | | | | | | | | Commit f828654e introduced the 'n' option, but it invoked gettimeofday() independently of the 'm' option. If both options were in use (or multiple 'n' options), or if 'n' was in use along with csvlog, then the reported times could be different for the same log message. To fix, initialize a global variable with gettimeofday() once per log message, and use that for both formats. Don't bother coordinating the time for the 't' option, which has much lower resolution. Per complaint by Alvaro Herrera.
* Add more sanity checks in contrib/sslinfoAlvaro Herrera2015-09-071-3/+22
| | | | | | | | | We were missing a few return checks on OpenSSL calls. Should be pretty harmless, since we haven't seen any user reports about problems, and this is not a high-traffic module anyway; still, a bug is a bug, so backpatch this all the way back to 9.0. Author: Michael Paquier, while reviewing another sslinfo patch
* Add log_line_prefix option 'n' for Unix epoch.Jeff Davis2015-09-073-0/+20
| | | | | | Prints time as Unix epoch with milliseconds. Tomas Vondra, reviewed by Fabien Coelho.
* Change type of DOW/DOY to UNITSGreg Stark2015-09-071-3/+3
|
* Make GIN's cleanup pending list process interruptableTeodor Sigaev2015-09-071-5/+3
| | | | | | | | | | | Cleanup process could be called by ordinary insert/update and could take a lot of time. Add vacuum_delay_point() to make this process interruptable. Under vacuum this call will also throttle a vacuum process to decrease system load, called from insert/update it will not throttle, and that reduces a latency. Backpatch for all supported branches. Jeff Janes <jeff.janes@gmail.com>
* Add pages deleted from pending list to FSMTeodor Sigaev2015-09-071-0/+23
| | | | | | | | | Add pages deleted from GIN's pending list during cleanup to free space map immediately. Clean up process could be initiated by ordinary insert but adding page to FSM might occur only at vacuum. On some workload like never-vacuumed insert-only tables it could cause a huge bloat. Jeff Janes <jeff.janes@gmail.com>
* Update site address of Snowball projectTeodor Sigaev2015-09-071-1/+1
|
* Adjust sepgsql regression output for recent error context changeJoe Conway2015-09-061-0/+1
| | | | | | | Recent commit 0426f349e changed handling of error context reports in such a way to have a minor effect on the sepgsql regression output. Adapt the expected output file to suit. Since that commit was HEAD only, so is this one.
* Support RADIUS passwords up to 128 charactersMagnus Hagander2015-09-061-20/+40
| | | | | | | Previous limit was 16 characters, due to lack of support for multiple passes of encryption. Marko Tiikkaja
* Add ability to reserve WAL upon slot creation via replication protocol.Andres Freund2015-09-065-3/+32
| | | | | | | | | | | | | | | Since 6fcd885 it is possible to immediately reserve WAL when creating a slot via pg_create_physical_replication_slot(). Extend the replication protocol to allow that as well. Although, in contrast to the SQL interface, it is possible to update the reserved location via the replication interface, it is still useful being able to reserve upon creation there. Otherwise the logic in ReplicationSlotReserveWal() has to be repeated in slot employing clients. Author: Michael Paquier Discussion: CAB7nPqT0Wc1W5mdYGeJ_wbutbwNN+3qgrFR64avXaQCiJMGaYA@mail.gmail.com
* Move DTK_ISODOW DTK_DOW and DTK_DOY to be type UNITS rather thanGreg Stark2015-09-062-43/+43
| | | | | | | | | | | | | | | | RESERV. RESERV is meant for tokens like "now" and having them in that category throws errors like these when used as an input date: stark=# SELECT 'doy'::timestamptz; ERROR: unexpected dtype 33 while parsing timestamptz "doy" LINE 1: SELECT 'doy'::timestamptz; ^ stark=# SELECT 'dow'::timestamptz; ERROR: unexpected dtype 32 while parsing timestamptz "dow" LINE 1: SELECT 'dow'::timestamptz; ^ Found by LLVM's Libfuzzer
* Fix CreateTableSpace() so it will compile without HAVE_SYMLINK.Tom Lane2015-09-051-2/+3
| | | | | | | | | This has been broken since 9.3 (commit 82b1b213cad3a69c to be exact), which suggests that nobody is any longer using a Windows build system that doesn't provide a symlink emulation. Still, it's wrong on its own terms, so repair. YUriy Zhuravlev
* Rearrange the handling of error context reports.Tom Lane2015-09-0548-610/+237
| | | | | | | | | | | | | | | | | | | | | | | | Remove the code in plpgsql that suppressed the innermost line of CONTEXT for messages emitted by RAISE commands. That was never more than a quick backwards-compatibility hack, and it's pretty silly in cases where the RAISE is nested in several levels of function. What's more, it violated our design theory that verbosity of error reports should be controlled on the client side not the server side. To alleviate the resulting noise increase, introduce a feature in libpq and psql whereby the CONTEXT field of messages can be suppressed, either always or only for non-error messages. Printing CONTEXT for errors only is now their default behavior. The actual code changes here are pretty small, but the effects on the regression test outputs are widespread. I had to edit some of the alternative expected outputs by hand; hopefully the buildfarm will soon find anything I fat-fingered. In passing, fix up (again) the output line counts in psql's various help displays. Add some commentary about how to verify them. Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others
* Fix misc typos.Heikki Linnakangas2015-09-0517-25/+25
| | | | Oskari Saarenmaa. Backpatch to stable branches where applicable.
* Fix brin index summarizing while vacuuming.Tatsuo Ishii2015-09-051-3/+6
| | | | | | | | | | | If the number of heap blocks is not multiples of pages per range, the summarizing produces wrong summary information for the last brin index tuple while vacuuming. Problem reported by Tatsuo Ishii and fixed by Amit Langote. Discussion at "[HACKERS] BRIN INDEX value (message id :20150903.174935.1946402199422994347.t-ishii@sraoss.co.jp) Backpatched to 9.5 in which brin index was added.
* Fix subtransaction cleanup after an outer-subtransaction portal fails.Tom Lane2015-09-048-29/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formerly, we treated only portals created in the current subtransaction as having failed during subtransaction abort. However, if the error occurred while running a portal created in an outer subtransaction (ie, a cursor declared before the last savepoint), that has to be considered broken too. To allow reliable detection of which ones those are, add a bookkeeping field to struct Portal that tracks the innermost subtransaction in which each portal has actually been executed. (Without this, we'd end up failing portals containing functions that had called the subtransaction, thereby breaking plpgsql exception blocks completely.) In addition, when we fail an outer-subtransaction Portal, transfer its resources into the subtransaction's resource owner, so that they're released early in cleanup of the subxact. This fixes a problem reported by Jim Nasby in which a function executed in an outer-subtransaction cursor could cause an Assert failure or crash by referencing a relation created within the inner subtransaction. The proximate cause of the Assert failure is that AtEOSubXact_RelationCache assumed it could blow away a relcache entry without first checking that the entry had zero refcount. That was a bad idea on its own terms, so add such a check there, and to the similar coding in AtEOXact_RelationCache. This provides an independent safety measure in case there are still ways to provoke the situation despite the Portal-level changes. This has been broken since subtransactions were invented, so back-patch to all supported branches. Tom Lane and Michael Paquier
* Make unaccent handle all diacritics known to Unicode, and expand ligatures ↵Teodor Sigaev2015-09-042-66/+415
| | | | | | | | | | correctly Add Python script for buiding unaccent.rules from Unicode data. Don't backpatch because unaccent changes may require tsvector/index rebuild. Thomas Munro <thomas.munro@enterprisedb.com>
* Assorted code review for recent ProcArrayLock patch.Robert Haas2015-09-033-15/+34
| | | | | | | | | | | | | | | Post-commit review by Andres Freund discovered a couple of concurrency bugs in the original patch: specifically, if the leader cleared a follower's XID before it reached PGSemaphoreLock, the semaphore would be left in the wrong state; and if another process did PGSemaphoreUnlock for some unrelated reason, we might resume execution before the fact that our XID was cleared was globally visible. Also, improve the wording of some comments, rename nextClearXidElem to firstClearXidElem in PROC_HDR for clarity, and drop some volatile qualifiers that aren't necessary. Amit Kapila, reviewed and slightly revised by me.
* Document that max_worker_processes must be high enough in standby.Fujii Masao2015-09-032-0/+9
| | | | | | | | | The setting values of some parameters including max_worker_processes must be equal to or higher than the values on the master. However, previously max_worker_processes was not listed as such parameter in the document. So this commit adds it to that list. Back-patch to 9.4 where max_worker_processes was added.
* Disable fsync throughout TAP test suites.Noah Misch2015-09-033-3/+6
| | | | | | | | | Most suites already did so via start_test_server(), but the pg_rewind, pg_ctl and pg_controldata suites ran a postmaster or initdb with fsync enabled. This halves the pg_rewind suite's runtime on buildfarm member tern. It makes tern and that machine's other buildfarm members less vulnerable to noise failures from postmaster startup overrunning the 60s pg_ctl timeout. Back-patch to 9.5, where pg_rewind was introduced.
* Update the SSL test suite for recent changes to TAP testing framework.Robert Haas2015-09-022-19/+9
| | | | | | | listen_addresses needs to be handled differently now, and so does logging. Michael Paquier
* Allow usage of huge maintenance_work_mem for GIN build.Teodor Sigaev2015-09-024-4/+12
| | | | | | | | | | | | | Currently, in-memory posting list during GIN build process is limited 1GB because of using repalloc. The patch replaces call of repalloc to repalloc_huge. It increases limit of posting list from 180 millions (1GB / sizeof(ItemPointerData)) to 4 billions limited by maxcount/count fields in GinEntryAccumulator and subsequent calls. Check added. Also, fix accounting of allocatedMemory during build to prevent integer overflow with maintenance_work_mem > 4GB. Robert Abraham <robert.abraham86@googlemail.com> with additions by me
* Document that PL/Python now returns floats using repr() not str().Tom Lane2015-09-011-10/+14
| | | | | Commit 1ce7a57ca neglected to update the user-facing documentation, which described the old behavior precisely.
* Flush to show results of TestLib.pm (TAP) test as we go.Kevin Grittner2015-09-011-0/+1
| | | | | It appears that some attempt was made to do this using autocommit, but it wasn't effective (at least on Ubuntu 14.04).
* pg_upgrade docs: clarify rsync and move verification stepBruce Momjian2015-09-011-15/+18
| | | | | | | | | These are adjustments based on someone using the new standby upgrade steps. Report by Andy Colson Backpatch through 9.5
* Allow notifications to bgworkers without database connections.Robert Haas2015-09-011-111/+25
| | | | | | | | | | | | | | | | | | Previously, if one background worker registered another background worker and set bgw_notify_pid while for the second background worker, it would not receive notifications from the postmaster unless, at the time the "parent" was registered, BGWORKER_BACKEND_DATABASE_CONNECTION was set. To fix, instead instead of including only those background workers that requested database connections in the postmater's BackendList, include them all. There doesn't seem to be any reason not do this, and indeed it removes a significant amount of duplicated code. The other option is to make PostmasterMarkPIDForWorkerNotify look at BackgroundWorkerList in addition to BackendList, but that adds more code duplication instead of getting rid of it. Patch by me. Review and testing by Ashutosh Bapat.
* Use <substeps> in pg_upgrade's procedureAlvaro Herrera2015-09-011-2/+2
| | | | | | | | For clarity, so that the substeps are not numbered identically to the outer procedure's steps. Per report from Andy Colson in http://www.postgresql.org/message-id/55D789B5.7040308@squeakycode.net
* Clean up icc + ia64 situation.Tom Lane2015-08-312-13/+26
| | | | | | | | | | | | | | Some googling turned up multiple sources saying that older versions of icc do not accept gcc-compatible asm blocks on IA64, though asm does work on x86[_64]. This is apparently fixed as of icc version 12.0 or so, but that doesn't help us much; if we have to carry the extra implementation anyway, we may as well just use it for icc rather than add a compiler version test. Hence, revert commit 2c713d6ea29c91cd2cbd92fa801a61e55ea2a3c4 (though I separated the icc code from the gcc code completely, producing what seems cleaner code). Document the state of affairs more explicitly, both in s_lock.h and postgres.c, and make some cosmetic adjustments around the IA64 code in s_lock.h.
* docs: remove outdated note about unique indexesBruce Momjian2015-08-311-5/+1
| | | | | | Patch by Josh Kupershmidt Backpatch through 9.5
* Allow icc to use the same atomics infrastructure as gcc.Tom Lane2015-08-312-30/+16
| | | | | | | | | | | The atomics headers were written under the impression that icc doesn't handle gcc-style asm blocks, but this is demonstrably false on x86_[64], because s_lock.h has done it that way for more than a decade. (The jury is still out on whether this also works on ia64, so I'm leaving ia64-related code alone for the moment.) Treat gcc and icc the same in these headers. This is less code and it should improve the results for icc, because we hadn't gotten around to providing icc-specific implementations for most of the atomics.
* Actually, it's not that hard to merge the Windows pqsignal code ...Tom Lane2015-08-312-35/+10
| | | | | ... just need to typedef sigset_t and provide sigemptyset/sigfillset, which are easy enough.
* Remove theoretically-unnecessary special case for icc.Tom Lane2015-08-311-11/+5
| | | | | | | | Intel's icc is generally able to swallow asm blocks written for gcc. We have a few places that don't seem to know that, though. Experiment with removing the special case for icc in ia64_get_bsp(); if the buildfarm likes this, I'll try more cleanup. This is a good test case because it involves a "stop" notation that seems like it might not be very portable.
* Remove support for Unix systems without the POSIX signal APIs.Tom Lane2015-08-3111-200/+27
| | | | | | | | | | | | | | | | | | | Remove configure's checks for HAVE_POSIX_SIGNALS, HAVE_SIGPROCMASK, and HAVE_SIGSETJMP. These APIs are required by the Single Unix Spec v2 (POSIX 1997), which we generally consider to define our minimum required set of Unix APIs. Moreover, no buildfarm member has reported not having them since 2012 or before, which means that even if the code is still live somewhere, it's untested --- and we've made plenty of signal-handling changes of late. So just take these APIs as given and save the cycles for configure probes for them. However, we can't remove as much C code as I'd hoped, because the Windows port evidently still uses the non-POSIX code paths for signal masking. Since we're largely emulating these BSD-style APIs for Windows anyway, it might be a good thing to switch over to POSIX-like notation and thereby remove a few more #ifdefs. But I'm not in a position to code or test that. In the meantime, we can at least make things a bit more transparent by testing for WIN32 explicitly in these places.
* psql: print longtable as a possible \pset optionBruce Momjian2015-08-311-1/+1
| | | | | | | For some reason this message was not updated when the longtable option was added. Backpatch through 9.3
* Small grammar fixMagnus Hagander2015-08-311-4/+4
| | | | Josh Kupershmidt
* Remove long-dead support for platforms without sig_atomic_t.Tom Lane2015-08-315-29/+0
| | | | | | | | | | | | C89 requires <signal.h> to define sig_atomic_t, and there is no evidence in the buildfarm that any supported platforms don't comply. Remove the configure test to stop wasting build cycles on a purely historical issue. (Once upon a time, we cared about supporting C89-compliant compilers on machines with pre-C89 system headers, but that use-case has been dead for quite a few years.) I have some other fixes planned in this area, but let's start with this to see if the buildfarm produces any surprising results.
* Fix sepgsql regression tests.Joe Conway2015-08-3011-378/+449
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regression tests for sepgsql were broken by changes in the base distro as-shipped policies. Specifically, definition of unconfined_t in the system default policy was changed to bypass multi-category rules, which the regression test depended on. Fix that by defining a custom privileged domain (sepgsql_regtest_superuser_t) and using it instead of system's unconfined_t domain. The new sepgsql_regtest_superuser_t domain performs almost like the current unconfined_t, but restricted by multi-category policy as the traditional unconfined_t was. The custom policy module is a self defined domain, and so should not be affected by related future system policy changes. However, it still uses the unconfined_u:unconfined_r pair for selinux-user and role. Those definitions have not been changed for several years and seem less risky to rely on than the unconfined_t domain. Additionally, if we define custom user/role, they would need to be manually defined at the operating system level, adding more complexity to an already non-standard and complex regression test. Back-patch to 9.3. The regression tests will need more work before working correctly on 9.2. Starting with 9.2, sepgsql has had dependencies on libselinux versions that are only available on newer distros with the changed set of policies (e.g. RHEL 7.x). On 9.1 sepgsql works fine with the older distros with original policy set (e.g. RHEL 6.x), and on which the existing regression tests work fine. We might want eventually change 9.1 sepgsql regression tests to be more independent from the underlying OS policies, however more work will be needed to make that happen and it is not clear that it is worth the effort. Kohei KaiGai with review by Adam Brightwell and me, commentary by Stephen, Alvaro, Tom, Robert, and others.
* Fix s_lock.h PPC assembly code to be compatible with native AIX assembler.Tom Lane2015-08-291-6/+10
| | | | | | | | | | | | | | | | | | | | | On recent AIX it's necessary to configure gcc to use the native assembler (because the GNU assembler hasn't been updated to handle AIX 6+). This caused PG builds to fail with assembler syntax errors, because we'd try to compile s_lock.h's gcc asm fragment for PPC, and that assembly code relied on GNU-style local labels. We can't substitute normal labels because it would fail in any file containing more than one inlined use of tas(). Fortunately, that code is stable enough, and the PPC ISA is simple enough, that it doesn't seem like too much of a maintenance burden to just hand-code the branch offsets, removing the need for any labels. Note that the AIX assembler only accepts "$" for the location counter pseudo-symbol. The usual GNU convention is "."; but it appears that all versions of gas for PPC also accept "$", so in theory this patch will not break any other PPC platforms. This has been reported by a few people, but Steve Underwood gets the credit for being the first to pursue the problem far enough to understand why it was failing. Thanks also to Noah Misch for additional testing.
* Ensure locks are acquired on RLS-added relationsStephen Frost2015-08-281-0/+19
| | | | | | | | During fireRIRrules(), get_row_security_policies can add to securityQuals and withCheckOptions. Make sure to lock any relations added at that point and before firing RIR rules on those expressions. Back-patch to 9.5 where RLS was added.
* Clarify what some historic terms in rewriteHandler.c mean.Andres Freund2015-08-281-0/+7
| | | | Discussion: 20150827131352.GF2435@awork2.anarazel.de
* Simplify Perl chmod callsPeter Eisentraut2015-08-271-15/+1
| | | | | The Perl chmod function already takes multiple file arguments, so we don't need a separate looping function.