aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Refactor per-page logic common to all redo routines to a new function.Heikki Linnakangas2014-09-02
| | | | | | | | | | | | Every redo routine uses the same idiom to determine what to do to a page: check if there's a backup block for it, and if not read, the buffer if the block exists, and check its LSN. Refactor that into a common function, XLogReadBufferForRedo, making all the redo routines shorter and more readable. This has no user-visible effect, and makes no changes to the WAL format. Reviewed by Andres Freund, Alvaro Herrera, Michael Paquier.
* Silence warning on new versions of clang.Heikki Linnakangas2014-09-02
| | | | Andres Freund
* Add psql PROMPT variable showing which line of a statement is being edited.Andres Freund2014-09-02
| | | | | | | | The new %l substitution shows the line number inside a (potentially multi-line) statement starting from one. Author: Sawada Masahiko, heavily editorialized by me. Reviewed-By: Jeevan Chalke, Alvaro Herrera
* Support ALTER SYSTEM RESET command.Fujii Masao2014-09-02
| | | | | | | This patch allows us to execute ALTER SYSTEM RESET command to remove the configuration entry from postgresql.auto.conf. Vik Fearing, reviewed by Amit Kapila and me.
* Fix unportable use of isspace().Tom Lane2014-09-01
| | | | Introduced in commit 11a020eb6.
* Add valgrind suppression for padding bytes in twophase records.Andres Freund2014-09-01
|
* Fix s/pluggins/plugins/ typo in two comments.Andres Freund2014-09-01
| | | | Michael Paquier
* Declare lwlock.c's LWLockAcquireCommon() as a static inline.Andres Freund2014-09-01
| | | | | | | | | | | | 68a2e52bbaf98f136 has introduced LWLockAcquireCommon() containing the previous contents of LWLockAcquire() plus added functionality. The latter then calls it, just like LWLockAcquireWithVar(). Because the majority of callers don't need the added functionality, declare the common code as inline. The compiler then can optimize away the unused code. Doing so is also useful when looking at profiles, to differentiate the users. Backpatch to 9.4, the first branch to contain LWLockAcquireCommon().
* Protect definition of SpinlockSemaArray, just like its declaration.Andres Freund2014-09-01
| | | | Found via clang's -Wmissing-variable-declarations.
* Declare two variables in snapbuild.c as static.Andres Freund2014-08-31
| | | | | Neither is accessed externally, I just seem to have missed the static when writing the code.
* Again update C comments for pg_attribute.attislocalBruce Momjian2014-08-30
|
* Make backend local tracking of buffer pins memory efficient.Andres Freund2014-08-30
| | | | | | | | | | | | | | | | | | | | | | | | Since the dawn of time (aka Postgres95) multiple pins of the same buffer by one backend have been optimized not to modify the shared refcount more than once. This optimization has always used a NBuffer sized array in each backend keeping track of a backend's pins. That array (PrivateRefCount) was one of the biggest per-backend memory allocations, depending on the shared_buffers setting. Besides the waste of memory it also has proven to be a performance bottleneck when assertions are enabled as we make sure that there's no remaining pins left at the end of transactions. Also, on servers with lots of memory and a correspondingly high shared_buffers setting the amount of random memory accesses can also lead to poor cpu cache efficiency. Because of these reasons a backend's buffers pins are now kept track of in a small statically sized array that overflows into a hash table when necessary. Benchmarks have shown neutral to positive performance results with considerably lower memory usage. Patch by me, review by Robert Haas. Discussion: 20140321182231.GA17111@alap3.anarazel.de
* Update C comment for pg_attribute.attislocalBruce Momjian2014-08-29
| | | | Indicates if column has ever been local/non-inherited
* pg_is_xlog_replay_paused(): remove super-user-only restrictionBruce Momjian2014-08-29
| | | | | | | | Also update docs to mention which function are super-user-only. Report by sys-milan@statpro.com Backpatch through 9.4
* Fix bug in compressed GIN data leaf page splitting code.Heikki Linnakangas2014-08-29
| | | | | | | | | The list of posting lists it's dealing with can contain placeholders for deleted posting lists. The placeholders are kept around so that they can be WAL-logged, but we must be careful to not try to access them. This fixes bug #11280, reported by Mårten Svantesson. Backpatch to 9.4, where the compressed data leaf page code was added.
* Assorted message improvementsPeter Eisentraut2014-08-29
|
* Add min and max aggregates for inet/cidr data types.Tom Lane2014-08-28
| | | | Haribabu Kommi, reviewed by Muhammad Asif Naeem
* Revert "Allow units to be specified in relation option setting value."Fujii Masao2014-08-29
| | | | | | | | | | | This reverts commit e23014f3d40f7d2c23bc97207fd28efbe5ba102b. As the side effect of the reverted commit, when the unit is specified, the reloption was stored in the catalog with the unit. This broke pg_dump (specifically, it prevented pg_dump from outputting restorable backup regarding the reloption) and turned the buildfarm red. Revert the commit until the fixed version is ready.
* Allow escaping of option values for options passed at connection start.Andres Freund2014-08-28
| | | | | | | | | | | | | | | This is useful to allow to set GUCs to values that include spaces; something that wasn't previously possible. The primary case motivating this is the desire to set default_transaction_isolation to 'repeatable read' on a per connection basis, but other usecases like seach_path do also exist. This introduces a slight backward incompatibility: Previously a \ in an option value would have been passed on literally, now it'll be taken as an escape. The relevant mailing list discussion starts with 20140204125823.GJ12016@awork2.anarazel.de.
* Allow units to be specified in relation option setting value.Fujii Masao2014-08-28
| | | | | | | | | This introduces an infrastructure which allows us to specify the units like ms (milliseconds) in integer relation option, like GUC parameter. Currently only autovacuum_vacuum_cost_delay reloption can accept the units. Reviewed by Michael Paquier
* Allow multibyte characters as escape in SIMILAR TO and SUBSTRING.Jeff Davis2014-08-27
| | | | | | | | Previously, only a single-byte character was allowed as an escape. This patch allows it to be a multi-byte character, though it still must be a single character. Reviewed by Heikki Linnakangas and Tom Lane.
* Fix FOR UPDATE NOWAIT on updated tuple chainsAlvaro Herrera2014-08-27
| | | | | | | | | | | | | | | | | | | | | If SELECT FOR UPDATE NOWAIT tries to lock a tuple that is concurrently being updated, it might fail to honor its NOWAIT specification and block instead of raising an error. Fix by adding a no-wait flag to EvalPlanQualFetch which it can pass down to heap_lock_tuple; also use it in EvalPlanQualFetch itself to avoid blocking while waiting for a concurrent transaction. Authors: Craig Ringer and Thomas Munro, tweaked by Álvaro http://www.postgresql.org/message-id/51FB6703.9090801@2ndquadrant.com Per Thomas Munro in the course of his SKIP LOCKED feature submission, who also provided one of the isolation test specs. Backpatch to 9.4, because that's as far back as it applies without conflicts (although the bug goes all the way back). To that branch also backpatch Thomas Munro's new NOWAIT test cases, committed in master by Heikki as commit 9ee16b49f0aac819bd4823d9b94485ef608b34e8 .
* Add header comments to receivelog.h and streamutil.h.Fujii Masao2014-08-27
| | | | | | This commit also adds the include guards to those header files. Michael Paquier
* Fix Var handling for security barrier viewsStephen Frost2014-08-26
| | | | | | | | | | | | | | | In some cases, not all Vars were being correctly marked as having been modified for updatable security barrier views, which resulted in invalid plans (eg: when security barrier views were created over top of inheiritance structures). In passing, be sure to update both varattno and varonattno, as _equalVar won't consider the Vars identical otherwise. This isn't known to cause any issues with updatable security barrier views, but was noticed as missing while working on RLS and makes sense to get fixed. Back-patch to 9.4 where updatable security barrier views were introduced.
* Fix typo in b34e37bfefbed1bf9396dde18f308d8b96fd176c.Robert Haas2014-08-26
| | | | Spotted by Peter Geoghegan.
* Fix superuser concurrent refresh of matview owned by another.Kevin Grittner2014-08-26
| | | | | | | | | | | Use SECURITY_LOCAL_USERID_CHANGE while building temporary tables; only escalate to SECURITY_RESTRICTED_OPERATION while potentially running user-supplied code. The more secure mode was preventing temp table creation. Add regression tests to cover this problem. This fixes Bug #11208 reported by Bruno Emanuel de Andrade Silva. Backpatch to 9.4, where the bug was introduced.
* Mark IsBinaryUpgrade as PGDLLIMPORT to fix windows builds after a7ae1dc.Andres Freund2014-08-26
| | | | Author: David Rowley
* Implement IF NOT EXISTS for CREATE SEQUENCE.Heikki Linnakangas2014-08-26
| | | | Fabrízio de Royes Mello
* Show schema names in pg_dump verbose output.Heikki Linnakangas2014-08-26
| | | | Fabrízio de Royes Mello, reviewed by Michael Paquier
* pg_upgrade: prevent automatic oid assignmentBruce Momjian2014-08-25
| | | | | | | | | | Prevent automatic oid assignment when in binary upgrade mode. Also throw an error when contrib/pg_upgrade_support functions are called when not in binary upgrade mode. This prevent automatically-assigned oids from conflicting with later pre-assigned oids coming from the old cluster. It also makes sure oids are preserved in call important cases.
* rename macro isTempOrToastNamespace to isTempOrTempToastNamespaceBruce Momjian2014-08-25
| | | | Done for clarity
* revert "Throw error for ALTER TABLE RESET of an invalid option"Bruce Momjian2014-08-25
| | | | | | Reverts commits 73d78e11a0f7183c80b93eefbbb6026fe9664015 and b0488e5c4fbfdce8acc989bdc17d9f0ec09ac281. Also reverts pg_upgrade changes.
* Throw error for ALTER TABLE RESET of an invalid optionBruce Momjian2014-08-25
| | | | | | | Also adjust pg_upgrade to not use this method for optional TOAST table creation. Patch by Fabrízio de Royes Mello
* pg_ctl, pg_upgrade: allow multiple -o/-O options, append themBruce Momjian2014-08-25
| | | | Report by Pavel Raiskup
* Revert XactLockTableWait context setup in conditional multixact waitAlvaro Herrera2014-08-25
| | | | | | | | | There's no point in setting up a context error callback when doing conditional lock acquisition, because we never actually wait and so the user wouldn't be able to see the context message anywhere. In fact, this is more in line with what ConditionalXactLockTableWait is doing. Backpatch to 9.4, where this was added.
* Use newly added InvalidCommandId instead of 0Alvaro Herrera2014-08-25
| | | | | | | | | The symbol was added by 71901ab6d; the original code was introduced by 6868ed749. Development of both overlapped which is why we apparently failed to notice. This is a (very slight) behavior change, so I'm not backpatching this to 9.4 for now, even though the symbol does exist there.
* DefineType: return base type OID, not its arrayAlvaro Herrera2014-08-25
| | | | | | Event triggers want to know the OID of the interesting object created, which is the main type. The array created as part of the operation is just a subsidiary object which is not of much interest.
* Have CREATE TABLE AS and REFRESH return an OIDAlvaro Herrera2014-08-25
| | | | | | Other DDL commands are already returning the OID, which is required for future additional event trigger work. This is merely making these commands in line with the rest of utility command support.
* More psprintf goodnessAlvaro Herrera2014-08-25
|
* Oops, forgot to "git add" one last changeAlvaro Herrera2014-08-25
|
* Editorial review of SET UNLOGGEDAlvaro Herrera2014-08-25
| | | | | | | | Add a succint comment explaining why it's correct to change the persistence in this way. Also s/loggedness/persistence/ because native speakers didn't like the latter term. Fabrízio and Álvaro
* Add regression tests for SELECT FOR UPDATE/SHARE NOWAIT.Heikki Linnakangas2014-08-25
| | | | Thomas Munro
* Fix another ancient memory-leak bug in relcache.c.Tom Lane2014-08-24
| | | | | | | | | | | | | | | | | | | | | | | | CheckConstraintFetch() leaked a cstring in the caller's context for each CHECK constraint expression it copied into the relcache. Ordinarily that isn't problematic, but it can be during CLOBBER_CACHE testing because so many reloads can happen during a single query; so complicate the code slightly to allow freeing the cstring after use. Per testing on buildfarm member barnacle. This is exactly like the leak fixed in AttrDefaultFetch() by commit 078b2ed291c758e7125d72c3a235f128d40a232b. (Yes, this time I did look for other instances of the same coding pattern :-(.) Like that patch, no back-patch, since it seems unlikely that there's any problem except under very artificial test conditions. BTW, it strikes me that both of these places would require further work comparable to commit ab8c84db2f7af008151b848cf1d6a4672a39eecd, if we ever supported defaults or check constraints on system catalogs: they both assume they are copying into an empty relcache data structure, and that conceivably wouldn't be the case during recursive reloading of a system catalog. This does not seem worth worrying about for the moment, since there is no near-term prospect of supporting any such thing. So I'll just note the possibility for the archives' sake.
* doc: Improve pg_restore help outputPeter Eisentraut2014-08-23
| | | | | | Add a note that some options can be specified multiple times to select multiple objects to restore. This replaces the somewhat confusing use of plurals in the option descriptions themselves.
* Implement ALTER TABLE .. SET LOGGED / UNLOGGEDAlvaro Herrera2014-08-22
| | | | | | | | | | | | This enables changing permanent (logged) tables to unlogged and vice-versa. (Docs for ALTER TABLE / SET TABLESPACE got shuffled in an order that hopefully makes more sense than the original.) Author: Fabrízio de Royes Mello Reviewed by: Christoph Berg, Andres Freund, Thom Brown Some tweaking by Álvaro Herrera
* Fix outdated commentAlvaro Herrera2014-08-22
|
* Fix corner-case behaviors in JSON/JSONB field extraction operators.Tom Lane2014-08-22
| | | | | | | | | | | | | | | | | | | | | Cause the path extraction operators to return their lefthand input, not NULL, if the path array has no elements. This seems more consistent since the case ought to correspond to applying the simple extraction operator (->) zero times. Cause other corner cases in field/element/path extraction to return NULL rather than failing. This behavior is arguably more useful than throwing an error, since it allows an expression index using these operators to be built even when not all values in the column are suitable for the extraction being indexed. Moreover, we already had multiple inconsistencies between the path extraction operators and the simple extraction operators, as well as inconsistencies between the JSON and JSONB code paths. Adopt a uniform rule of returning NULL rather than throwing an error when the JSON input does not have a structure that permits the request to be satisfied. Back-patch to 9.4. Update the release notes to list this as a behavior change since 9.3.
* Fix comment in pg_basebackup.Heikki Linnakangas2014-08-22
| | | | | | The option is called --tablespace-mapping, not --tablespace. Amit Kapila
* Change the way pg_basebackup's tablespace mapping is implemented.Heikki Linnakangas2014-08-22
| | | | | | | | | | | | | | | | Previously, we would first create the symlinks the way they are in the original system, and at the end replace them with the mapped symlinks. That never really made much sense, so now we create the symlink pointing to the correct location to begin with, so that there's no need to fix them at the end. The old coding didn't work correctly on Windows, because Windows junction points look more like directories than files, and ought to be removed with rmdir rather than unlink. Also, it incorrectly used "%d" rather than "%u" to print an Oid, but that's gone now. Report and patch by Amit Kapila, with minor changes by me. Reviewed by MauMau. Backpatch to 9.4, where the --tablespace feature was added.
* Fix whitespacePeter Eisentraut2014-08-21
|