summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-09-16Don't use "#" as an abbreviation for "number" in PL/Tcl error messages.Tom Lane
Also, rewrite one error message to make it follow our message style guidelines better. Euler Taveira and Tom Lane
2015-09-16Remove no-longer-used T_PrivGrantee node tag.Tom Lane
Oversight in commit 31eae6028eca4365e7165f5f33fee1ed0486aee0, which replaced PrivGrantee nodes with RoleSpec nodes. Spotted by Yugo Nagata.
2015-09-16pgbench progress with timestampTeodor Sigaev
This patch adds an option to replace the "time since pgbench run started" with a Unix epoch timestamp in the progress report so that, for instance, it is easier to compare timelines with pgsql log Fabien COELHO <coelho@cri.ensmp.fr>
2015-09-16Review program help output for wording and formattingPeter Eisentraut
2015-09-15Enforce ALL/SELECT policies in RETURNING for RLSStephen Frost
For the UPDATE/DELETE RETURNING case, filter the records which are not visible to the user through ALL or SELECT policies from those considered for the UPDATE or DELETE. This is similar to how the GRANT system works, which prevents RETURNING unless the caller has SELECT rights on the relation. Per discussion with Robert, Dean, Tom, and Kevin. Back-patch to 9.5 where RLS was introduced.
2015-09-15RLS refactoringStephen Frost
This refactors rewrite/rowsecurity.c to simplify the handling of the default deny case (reducing the number of places where we check for and add the default deny policy from three to one) by splitting up the retrival of the policies from the application of them. This also allowed us to do away with the policy_id field. A policy_name field was added for WithCheckOption policies and is used in error reporting, when available. Patch by Dean Rasheed, with various mostly cosmetic changes by me. Back-patch to 9.5 where RLS was introduced to avoid unnecessary differences, since we're still in alpha, per discussion with Robert.
2015-09-15Fix whitespacePeter Eisentraut
2015-09-15Revert "Fix an O(N^2) problem in foreign key references".Tom Lane
Commit 5ddc72887a012f6a8b85707ef27d85c274faf53d does not actually work because it will happily blow away ri_constraint_cache entries that are in active use in outer call levels. In any case, it's a very ugly, brute-force solution to the problem of limiting the cache size. Revert until it can be redesigned.
2015-09-15Fix comment regarding the meaning of infinity for timeline history entryFujii Masao
Michael Paquier
2015-09-15Improve log messages related to tablespace_map fileFujii Masao
This patch changes the log message which is logged when the server successfully renames backup_label file to *.old but fails to rename tablespace_map file during the shutdown. Previously the WARNING message "online backup mode was not canceled" was logged in that case. However this message is confusing because the backup mode is treated as canceled whenever backup_label is successfully renamed. So this commit makes the server log the message "online backup mode canceled" in that case. Also this commit changes errdetail messages so that they follow the error message style guide. Back-patch to 9.5 where tablespace_map file is introduced. Original patch by Amit Kapila, heavily modified by me.
2015-09-15Fix wrong comment in commit d02426029b133ee2bbe492a038642359bce3c527Teodor Sigaev
Per gripe from Robert Haas
2015-09-14Check existency of table/schema for -t/-n option (pg_dump/pg_restore)Teodor Sigaev
Patch provides command line option --strict-names which requires that at least one table/schema should present for each -t/-n option. Pavel Stehule <pavel.stehule@gmail.com>
2015-09-13Add noreturn attributePeter Eisentraut
per gcc -Wsuggest-attribute=noreturn
2015-09-13Fix the fastpath rule for jsonb_concat with an empty operand.Andrew Dunstan
To prevent perverse results, we now only return the other operand if it's not scalar, and if both operands are of the same kind (array or object). Original bug complaint and patch from Oskari Saarenmaa, extended by me to cover the cases of different kinds of jsonb. Backpatch to 9.5 where jsonb_concat was introduced.
2015-09-12Update SQL features listPeter Eisentraut
2015-09-11Install lwlocknames.h even in vpath builds.Robert Haas
Per buildfarm member crake.
2015-09-11pg_dump, pg_upgrade: allow postgres/template1 tablespace movesBruce Momjian
Modify pg_dump to restore postgres/template1 databases to non-default tablespaces by switching out of the database to be moved, then switching back. Also, to fix potentially cases where the old/new tablespaces might not match, fix pg_upgrade to process new/old tablespaces separately in all cases. Report by Marti Raudsepp Patch by Marti Raudsepp, me Backpatch through 9.0
2015-09-11Fix build problems in commit aa65de042f5828968f2f6cd65f45c543a40cc3e6.Robert Haas
The previous way didn't work for vpath builds, and make distprep was busted too. Reported off-list by Andres Freund.
2015-09-11Add missing ReleaseBuffer call in BRIN revmap codeAlvaro Herrera
I think this particular branch is actually dead, but the analysis to prove that is not trivial, so instead take the weasel way. Reported by Jinyu Zhang Backpatch to 9.5, where BRIN was introduced.
2015-09-11Fix an O(N^2) problem in foreign key references.Kevin Grittner
Commit 45ba424f improved foreign key lookups during bulk updates when the FK value does not change. When restoring a schema dump from a database with many (say 100,000) foreign keys, this cache would grow very big and every ALTER TABLE command was causing an InvalidateConstraintCacheCallBack(), which uses a sequential hash table scan. This could cause a severe performance regression in restoring a schema dump (including during pg_upgrade). The patch uses a heuristic method of detecting when the hash table should be destroyed and recreated. InvalidateConstraintCacheCallBack() adds the current size of the hash table to a counter. When that sum reaches 1,000,000, the hash table is flushed. This fixes the regression without noticeable harm to the bulk update use case. Jan Wieck Backpatch to 9.3 where the performance regression was introduced.
2015-09-11When trace_lwlocks is used, identify individual lwlocks by name.Robert Haas
Naming the individual lwlocks seems like something that may be useful for other types of debugging, monitoring, or instrumentation output, but this commit just implements it for the specific case of trace_lwlocks. Patch by me, reviewed by Amit Kapila and Kyotaro Horiguchi
2015-09-10Fix setrefs.c comment properly.Tom Lane
The "typo" alleged in commit 1e460d4bd was actually a comment that was correct when written, but I missed updating it in commit b5282aa89. Use a slightly less specific (and hopefully more future-proof) description of what is collected. Back-patch to 9.2 where that commit appeared, and revert the comment to its then-entirely-correct state before that.
2015-09-10Fix typo in setrefs.cStephen Frost
We're adding OIDs, not TIDs, to invalItems. Pointed out by Etsuro Fujita. Back-patch to all supported branches.
2015-09-09Fix minor bug in regexp makesearch() function.Tom Lane
The list-wrangling here was done wrong, allowing the same state to get put into the list twice. The following loop then would clone it twice. The second clone would wind up with no inarcs, so that there was no observable misbehavior AFAICT, but a useless state in the finished NFA isn't an especially good thing.
2015-09-09Fix oversight in 013ebc0a7b7ea9c1b1ab7a3d4dd75ea121ea8ba7 commitTeodor Sigaev
Declaration of varibale inside ÓÝ×Õ
2015-09-09Microvacuum for GISTTeodor Sigaev
Mark index tuple as dead if it's pointed by kill_prior_tuple during ordinary (search) scan and remove it during insert process if there is no enough space for new tuple to insert. This improves select performance because index will not return tuple marked as dead and improves insert performance because it reduces number of page split. Anastasia Lubennikova <a.lubennikova@postgrespro.ru> with minor editorialization by me
2015-09-09Remove files signaling a standby promotion request at postmaster startupFujii Masao
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
2015-09-08Lock all relations referred to in updatable viewsStephen Frost
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.
2015-09-08psql: Generic tab completion support for enum and bool GUCs.Andres Freund
Author: Pavel Stehule Reviewed-By: Andres Freund Discussion: 5594FE7A.5050205@iki.fi
2015-09-09Add gin_fuzzy_search_limit to postgresql.conf.sample.Fujii Masao
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.
2015-09-09Improve tab-completion for GRANT and REVOKE.Fujii Masao
Thomas Munro, reviewed by Michael Paquier, modified by me.
2015-09-08Allow per-tablespace effective_io_concurrencyAlvaro Herrera
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
2015-09-07In the pg_rewind test suite, receive WAL fully before promoting.Noah Misch
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.
2015-09-07Coordinate log_line_prefix options 'm' and 'n' to share a timeval.Jeff Davis
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.
2015-09-07Add log_line_prefix option 'n' for Unix epoch.Jeff Davis
Prints time as Unix epoch with milliseconds. Tomas Vondra, reviewed by Fabien Coelho.
2015-09-07Change type of DOW/DOY to UNITSGreg Stark
2015-09-07Make GIN's cleanup pending list process interruptableTeodor Sigaev
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>
2015-09-07Add pages deleted from pending list to FSMTeodor Sigaev
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>
2015-09-06Support RADIUS passwords up to 128 charactersMagnus Hagander
Previous limit was 16 characters, due to lack of support for multiple passes of encryption. Marko Tiikkaja
2015-09-06Add ability to reserve WAL upon slot creation via replication protocol.Andres Freund
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
2015-09-06Move DTK_ISODOW DTK_DOW and DTK_DOY to be type UNITS rather thanGreg Stark
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
2015-09-05Fix CreateTableSpace() so it will compile without HAVE_SYMLINK.Tom Lane
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
2015-09-05Rearrange the handling of error context reports.Tom Lane
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
2015-09-05Fix misc typos.Heikki Linnakangas
Oskari Saarenmaa. Backpatch to stable branches where applicable.
2015-09-05Fix brin index summarizing while vacuuming.Tatsuo Ishii
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.
2015-09-04Fix subtransaction cleanup after an outer-subtransaction portal fails.Tom Lane
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
2015-09-03Assorted code review for recent ProcArrayLock patch.Robert Haas
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.
2015-09-03Document that max_worker_processes must be high enough in standby.Fujii Masao
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.
2015-09-03Disable fsync throughout TAP test suites.Noah Misch
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.
2015-09-02Update the SSL test suite for recent changes to TAP testing framework.Robert Haas
listen_addresses needs to be handled differently now, and so does logging. Michael Paquier