aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Fix typo in comment.Robert Haas2016-02-05
| | | | Michael Paquier
* Remove parallel-safety check from GetExistingLocalJoinPath.Robert Haas2016-02-05
| | | | | | | Commit a104a017fc5f67ff5d9c374cd831ac3948a874c2 has this check because I added it to the submitted patch before commit, but that was entirely wrongheaded, as explained to me by Ashutosh Bapat, who also wrote this patch.
* Fix small goof in comment.Robert Haas2016-02-05
| | | | Peter Geoghegan
* Fix typo.Robert Haas2016-02-05
| | | | Amit Kapila
* Add num_nulls() and num_nonnulls() to count NULL arguments.Tom Lane2016-02-04
| | | | | | | | | An example use-case is "CHECK(num_nonnulls(a,b,c) = 1)" to assert that exactly one of a,b,c isn't NULL. The functions are variadic, so they can also be pressed into service to count the number of null or nonnull elements in an array. Marko Tiikkaja, reviewed by Pavel Stehule
* When modifying a foreign table, initialize tableoid field properly.Robert Haas2016-02-04
| | | | | | | Failure to do this can cause AFTER ROW triggers or RETURNING expressions that reference this field to misbehave. Etsuro Fujita, reviewed by Thom Brown
* Improve error messagePeter Eisentraut2016-02-04
|
* Add some additional core functions to support join pushdown for FDWs.Robert Haas2016-02-04
| | | | | | | | GetExistingLocalJoinPath() is useful for handling EvalPlanQual rechecks properly, and GetUserMappingById() is needed to make sure you're using the right credentials. Shigeru Hanada, Etsuro Fujita, Ashutosh Bapat, Robert Haas
* Change the way that LWLocks for extensions are allocated.Robert Haas2016-02-04
| | | | | | | | | | | | | | The previous RequestAddinLWLocks() method had several disadvantages. First, the locks would be in the main tranche; we've recently decided that it's useful for LWLocks used for separate purposes to have separate tranche IDs. Second, there wasn't any correlation between what code called RequestAddinLWLocks() and what code called LWLockAssign(); when multiple modules are in use, it could become quite difficult to troubleshoot problems where LWLockAssign() ran out of locks. To fix, create a concept of named LWLock tranches which can be used either by extension or by core code. Amit Kapila and Robert Haas
* In pg_dump, ensure that view triggers are processed after view rules.Tom Lane2016-02-04
| | | | | | | | | | | | | | | | | | | If a view is split into CREATE TABLE + CREATE RULE to break a circular dependency, then any triggers on the view must be dumped/reloaded after the CREATE RULE; else the backend may reject the CREATE TRIGGER because it's the wrong type of trigger for a plain table. This works all right in plain dump/restore because of pg_dump's sorting heuristic that places triggers after rules. However, when using parallel restore, the ordering must be enforced by a dependency --- and we didn't have one. Fixing this is a mere matter of adding an addObjectDependency() call, except that we need to be able to find all the triggers belonging to the view relation, and there was no easy way to do that. Add fields to pg_dump's TableInfo struct to remember where the associated TriggerInfo struct(s) are. Per bug report from Dennis Kögel. The failure can be exhibited at least as far back as 9.1, so back-patch to all supported branches.
* Extend sortsupport for text to more opclasses.Robert Haas2016-02-03
| | | | | | | | | | | | | | | | Have varlena.c expose an interface that allows the char(n), bytea, and bpchar types to piggyback on a now-generalized SortSupport for text. This pushes a little more knowledge of the bpchar/char(n) type into varlena.c than might be preferred, but that seems like the approach that creates least friction. Also speed things up for index builds that use text_pattern_ops or varchar_pattern_ops. This patch does quite a bit of renaming, but it seems likely to be worth it, so as to avoid future confusion about the fact that this code is now more generally used than the old names might have suggested. Peter Geoghegan, reviewed by Álvaro Herrera and Andreas Karlsson, with small tweaks by me.
* Allow parallel custom and foreign scans.Robert Haas2016-02-03
| | | | | | | | | | This patch doesn't put the new infrastructure to use anywhere, and indeed it's not clear how it could ever be used for something like postgres_fdw which has to send an SQL query and wait for a reply, but there might be FDWs or custom scan providers that are CPU-bound, so let's give them a way to join club parallel. KaiGai Kohei, reviewed by me.
* Remove CustomPath's TextOutCustomPath method.Robert Haas2016-02-03
| | | | | | | | | | You can't really do anything useful with this in the form it currently exists; among other problems, there's no way to reread whatever information might be produced when the path is output. Work is underway to replace this with a more useful and more general system of extensible nodes, but let's start by getting rid of this bit. Extracted from a larger patch by KaiGai Kohei.
* Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage.Tom Lane2016-02-03
| | | | | | | | | | | Commit e09996ff8dee3f70 was one brick shy of a load: it didn't insist that the detected JSON number be the whole of the supplied string. This allowed inputs such as "2016-01-01" to be misdetected as valid JSON numbers. Per bug #13906 from Dmitry Ryabov. In passing, be more wary of zero-length input (I'm not sure this can happen given current callers, but better safe than sorry), and do some minor cosmetic cleanup.
* Add support for systemd service notificationsPeter Eisentraut2016-02-02
| | | | | | | | Insert sd_notify() calls at server start and stop for integration with systemd. This allows the use of systemd service units of type "notify", which greatly simplifies the systemd configuration. Reviewed-by: Pavel Stěhule <pavel.stehule@gmail.com>
* Improve error reporting when location specified by postgres -D does not existPeter Eisentraut2016-02-02
| | | | | | Previously, the first error seen would be that postgresql.conf does not exist. But for the case where the whole directory does not exist, give an error message about that, together with a hint for how to create one.
* Remove printQueryOpt.quote field.Tom Lane2016-02-02
| | | | | | This field was included in the original definition of the printQueryOpt struct in commit a45195a191eec367, but it was not used anywhere in that commit, nor since then. Spotted by Dickson S. Guedes.
* Don't test for system columns on join relationsAlvaro Herrera2016-02-02
| | | | | | | | | | | | create_foreignscan_plan needs to know whether any system columns are requested from a relation (this flag is needed by ForeignNext during execution). However, for join relations this is a pointless test, because it's not possible to request system columns from them, so remove the check. Author: Etsuro Fujita Discussion: http://www.postgresql.org/message-id/56AA0FC5.9000207@lab.ntt.co.jp Reviewed-by: David Rowley, Robert Haas
* Remove unnecessary "implementation of FOO operator" DESCR() entries.Tom Lane2016-02-02
| | | | | | | | | Apparently at least one committer hasn't gotten the word that these do not need to be maintained by hand, since initdb will create them automatically. Noted while fixing bug #13905. No catversion bump since the post-initdb state is exactly the same either way. I don't see a need for back-patch, either.
* Fix pg_description entries for jsonb_to_record() and jsonb_to_recordset().Tom Lane2016-02-02
| | | | | | | | | All the other jsonb function descriptions refer to the arguments as being "jsonb", but these two said "json". Make it consistent. Per bug #13905 from Petru Florin Mihancea. No catversion bump --- we can't force one in the back branches, and this isn't very critical anyway.
* Fix typo in commentMagnus Hagander2016-02-02
|
* Fix lossy KNN GiST when ordering operator returns non-float8 value.Teodor Sigaev2016-02-02
| | | | | | | | | | | | | | | | | KNN GiST with recheck flag should return to executor the same type as ordering operator, GiST detects this type by looking to return type of function which implements ordering operator. But occasionally detecting code works after replacing ordering operator function to distance support function. Distance support function always returns float8, so, detecting code get float8 instead of actual return type of ordering operator. Built-in opclasses don't have ordering operator which doesn't return non-float8 value, so, tests are impossible here, at least now. Backpatch to 9.5 where lozzy KNN was introduced. Author: Alexander Korotkov Report by: Artur Zakirov
* Make all built-in lwlock tranche IDs fixed.Robert Haas2016-02-02
| | | | | | | This makes the values more stable, which seems like a good thing for anybody who needs to look at at them. Alexander Korotkov and Amit Kapila
* pgbench: allow per-script statisticsAlvaro Herrera2016-02-01
| | | | | | | | | | Provide per-script statistical info (count of transactions executed under that script, average latency for the whole script) after a multi-script run, adding an intermediate level of detail to existing global stats and per-command stats. Author: Fabien Coelho Reviewer: Michaël Paquier, Álvaro Herrera
* pgbench: Install guards against obscure overflow conditions.Robert Haas2016-02-01
| | | | | | | Dividing INT_MIN by -1 or taking INT_MIN modulo -1 can sometimes cause floating-point exceptions or otherwise misbehave. Fabien Coelho and Michael Paquier
* Various fixes to "ALTER ... SET/RESET" tab completionsFujii Masao2016-02-01
| | | | | | | | | | | | Add - ALTER SYSTEM SET/RESET ... -> GUC variables - ALTER TABLE ... SET WITH -> OIDS - ALTER DATABASE/FUNCTION/ROLE/USER ... SET/RESET -> GUC variables - ALTER DATABASE/FUNCTION/ROLE/USER ... SET ... -> FROM CURRENT/TO - ALTER DATABASE/FUNCTION/ROLE/USER ... SET ... TO/= -> possible values Author: Fujii Masao Reviewed-by: Michael Paquier, Masahiko Sawada
* Make sure ecpg header files do not have a comment lasting several lines, one ofMichael Meskes2016-02-01
| | | | which is a preprocessor directive. This leads ecpg to incorrectly parse the comment as nested.
* Fix typos in commentsMagnus Hagander2016-02-01
| | | | Author: Michael Paquier
* Fix misspelled function name in comment.Heikki Linnakangas2016-02-01
|
* Fix whitespacePeter Eisentraut2016-01-30
|
* Migrate replication slot I/O locks into a separate tranche.Robert Haas2016-01-29
| | | | | | | | | This is following in a long train of similar changes and for the same reasons - see b319356f0e94a6482c726cf4af96597c211d8d6e and fe702a7b3f9f2bc5bf6d173166d7d55226af82c8 inter alia. Author: Amit Kapila Reviewed-by: Alexander Korotkov, Robert Haas
* Migrate PGPROC's backendLock into PGPROC itself, using a new tranche.Robert Haas2016-01-29
| | | | | | | | | | | | | Previously, each PGPROC's backendLock was part of the main tranche, and the PGPROC just contained a pointer. Now, the actual LWLock is part of the PGPROC. As with previous, similar patches, this makes it significantly easier to identify these lwlocks in LWLOCK_STATS or Trace_lwlocks output and improves modularity. Author: Ildus Kurbangaliev Reviewed-by: Amit Kapila, Robert Haas
* pgbench: refactor handling of stats trackingAlvaro Herrera2016-01-29
| | | | | | | | This doesn't add any functionality but just shuffles things around so that it can be reused and improved later. Author: Fabien Coelho Reviewed-by: Michael Paquier, Álvaro Herrera
* Fix incorrect pattern-match processing in psql's \det command.Tom Lane2016-01-29
| | | | | | | | | | | | | | listForeignTables' invocation of processSQLNamePattern did not match up with the other ones that handle potentially-schema-qualified names; it failed to make use of pg_table_is_visible() and also passed the name arguments in the wrong order. Bug seems to have been aboriginal in commit 0d692a0dc9f0e532. It accidentally sort of worked as long as you didn't inquire too closely into the behavior, although the silliness was later exposed by inconsistencies in the test queries added by 59efda3e50ca4de6 (which I probably should have questioned at the time, but didn't). Per bug #13899 from Reece Hart. Patch by Reece Hart and Tom Lane. Back-patch to all affected branches.
* Only try to push down foreign joins if the user mapping OIDs match.Robert Haas2016-01-28
| | | | | | | | | | | | | Previously, the foreign join pushdown infrastructure left the question of security entirely up to individual FDWs, but it would be easy for a foreign data wrapper to inadvertently open up subtle security holes that way. So, make it the core code's job to determine which user mapping OID is relevant, and don't attempt join pushdown unless it's the same for all relevant relations. Per a suggestion from Tom Lane. Shigeru Hanada and Ashutosh Bapat, reviewed by Etsuro Fujita and KaiGai Kohei, with some further changes by me.
* Avoid multiple foreign server connections when all use same user mapping.Robert Haas2016-01-28
| | | | | | | | | | | | | | | | Previously, postgres_fdw's connection cache was keyed by user OID and server OID, but this can lead to multiple connections when it's not really necessary. In particular, if all relevant users are mapped to the public user mapping, then their connection options are certainly the same, so one connection can be used for all of them. While we're cleaning things up here, drop the "server" argument to GetConnection(), which isn't really needed. This saves a few cycles because callers no longer have to look this up; the function itself does, but only when establishing a new connection, not when reusing an existing one. Ashutosh Bapat, with a few small changes by me.
* Fix typos in comments and docFujii Masao2016-01-28
| | | | | | | overriden -> overridden The misspelling in create_extension.sgml was introduced in b67aaf2, so no need to backpatch.
* Add gin_clean_pending_list function to clean up GIN pending listFujii Masao2016-01-28
| | | | | | | | | | | | | | | | This function cleans up the pending list of the GIN index by moving entries in it to the main GIN data structure in bulk. It returns the number of pages cleaned up from the pending list. This function is useful, for example, when the pending list needs to be cleaned up *quickly* to improve the performance of the search using GIN index. VACUUM can do the same thing, too, but it may take days to run on a large table. Jeff Janes, reviewed by Julien Rouhaud, Jaime Casanova, Alvaro Herrera and me. Discussion: CAMkU=1x8zFkpfnozXyt40zmR3Ub_kHu58LtRmwHUKRgQss7=iQ@mail.gmail.com
* Assert that create_unique_path returns non-NULL.Robert Haas2016-01-27
| | | | | Per off-list discussion with Tom Lane and Michael Paquier, Coverity gets unhappy if this is not done.
* Fix cross-version pg_dump for aggregate combine functions.Robert Haas2016-01-27
| | | | | | | Fixes a defect in commit a7de3dc5c346e07e0439275982569996e645b3c2. David Rowley, per report from Jeff Janes, who also checked that the fix works.
* Fix volatility marking of pg_size_pretty functionFujii Masao2016-01-27
| | | | | | | pg_size_pretty function should be marked immutable rather than volatile because it always returns the same result given the same argument. Pavel Stehule
* pgbench: improve multi-script supportAlvaro Herrera2016-01-27
| | | | | | | | | | | Previously, it was possible to specify one or several custom scripts to run, or only one of the builtin scripts. With this patch it is also possible to specify to run the builtin scripts multiple times, using the new -b option. Also, unify the code for both cases; this eases future pgbench improvements. Author: Fabien Coelho Review: Michaël Paquier, Álvaro Herrera
* Mostly mechanical cleanup of pgbenchAlvaro Herrera2016-01-27
| | | | | | | | pgindent for recent commits; also change some variables from int to boolean, which is how they are really used. Mostly submitted by Fabien Coelho; this is in preparation to commit further patches to the file.
* Fix startup so that log prefix %h works for the log_connections message.Tom Lane2016-01-26
| | | | | | | We entirely randomly chose to initialize port->remote_host just after printing the log_connections message, when we could perfectly well do it just before, allowing %h and %r to work for that message. Per gripe from Artem Tomyuk.
* Improve ResourceOwners' behavior for large numbers of owned objects.Tom Lane2016-01-26
| | | | | | | | | | | | | | | | | | The original coding was quite fast so long as objects were always released in reverse order of addition; otherwise, it degenerated into O(N^2) behavior due to searching for the array element to delete. Improve matters by switching to hashed storage when the number of objects of a given type exceeds 64. (The cutover point is open to discussion, of course, but some simple performance testing suggests that hashing has enough overhead to be a loser below there.) Also, refactor resowner.c so that we don't need N copies of the array management code. Since all the resource IDs the code currently needs to deal with are either pointers or integers, it seems sufficient to create a one-size-fits-all infrastructure in which everything is converted to a Datum for storage. Aleksander Alekseev, reviewed by Stas Kelvich, further fixes by me
* Various fixes to REFRESH MATERIALIZED VIEW tab completion.Kevin Grittner2016-01-26
| | | | Masahiko Sawada, Fujii Masao, Kevin Grittner
* Revert "Fix broken multibyte regression tests."Tatsuo Ishii2016-01-26
| | | | | | This reverts commit efc1610b64b04e7cf08cc1d6c608ede8b7d5ff07. The commit was plain wrong as pointed out in: http://www.postgresql.org/message-id/27771.1448736909@sss.pgh.pa.us
* Correct comment in GetConflictingVirtualXIDs()Simon Riggs2016-01-24
| | | | We use Share lock because it is safe to do so.
* Yet further adjust degree-based trig functions for more portability.Tom Lane2016-01-24
| | | | | | | Buildfarm member cockatiel is still saying that cosd(60) isn't 0.5. What seems likely is that the subexpression (1.0 - cos(x)) isn't being rounded to double width before more arithmetic is done on it, so force that by storing it into a variable.
* Still further adjust degree-based trig functions for more portability.Tom Lane2016-01-23
| | | | | Indeed, the non-static declaration foreseen in my previous commit message is necessary. Per Noah Misch.