summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-09-05Report timezone offset in pg_dump/pg_dumpallBruce Momjian
Use consistent format for all such displays. Report by Gavin Flower
2014-09-05Rename C variables in formatting.c, for clarityBruce Momjian
Also add C comments. This should help future debugging of this notorious file.
2014-09-05Assorted message fixes and improvementsPeter Eisentraut
2014-09-05Add tab-completion for reloptions like user_catalog_table.Fujii Masao
Back-patch to 9.4 where user_catalog_table was added. Review by Michael Paquier
2014-09-05Fix segmentation fault that an empty prepared statement could cause.Fujii Masao
Back-patch to all supported branches. Per bug #11335 from Haruka Takatsuka
2014-09-04Update comment to reflect commit 1d41739e5a04b0e93304d24d864b6bfa3efc45f2.Robert Haas
Peter Geoghegan
2014-09-04Allow \watch to display query execution time if \timing is enabled.Fujii Masao
Previously \watch could not display the query execution time even when \timing was enabled because it used PSQLexec instead of SendQuery and that function didn't support \timing. This patch introduces PSQLexecWatch and changes \watch so as to use it, instead. PSQLexecWatch is the function to run the query, print its results and display how long it took (only when \timing is enabled). This patch also changes --echo-hidden so that it doesn't print the query that \watch executes. Since \watch cannot execute backslash command queries, they should not be printed even when --echo-hidden is set. Patch by me, review by Heikki Linnakangas and Michael Paquier
2014-09-03Issue clearer notice when inherited merged columns are movedBruce Momjian
CREATE TABLE INHERIT moves user-specified columns to the location of the inherited column. Report by Fatal Majid
2014-09-02Check number of parameters in RAISE statement at compile time.Heikki Linnakangas
The number of % parameter markers in RAISE statement should match the number of parameters given. We used to check that at execution time, but we have all the information needed at compile time, so let's check it at compile time instead. It's generally better to find mistakes earlier. Marko Tiikkaja, reviewed by Fabien Coelho
2014-09-02Refactor per-page logic common to all redo routines to a new function.Heikki Linnakangas
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.
2014-09-02Silence warning on new versions of clang.Heikki Linnakangas
Andres Freund
2014-09-02Add psql PROMPT variable showing which line of a statement is being edited.Andres Freund
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
2014-09-02Support ALTER SYSTEM RESET command.Fujii Masao
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.
2014-09-01Fix unportable use of isspace().Tom Lane
Introduced in commit 11a020eb6.
2014-09-01Add valgrind suppression for padding bytes in twophase records.Andres Freund
2014-09-01Fix s/pluggins/plugins/ typo in two comments.Andres Freund
Michael Paquier
2014-09-01Declare lwlock.c's LWLockAcquireCommon() as a static inline.Andres Freund
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().
2014-09-01Protect definition of SpinlockSemaArray, just like its declaration.Andres Freund
Found via clang's -Wmissing-variable-declarations.
2014-08-31Declare two variables in snapbuild.c as static.Andres Freund
Neither is accessed externally, I just seem to have missed the static when writing the code.
2014-08-30Again update C comments for pg_attribute.attislocalBruce Momjian
2014-08-30Make backend local tracking of buffer pins memory efficient.Andres Freund
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
2014-08-29Update C comment for pg_attribute.attislocalBruce Momjian
Indicates if column has ever been local/non-inherited
2014-08-29pg_is_xlog_replay_paused(): remove super-user-only restrictionBruce Momjian
Also update docs to mention which function are super-user-only. Report by sys-milan@statpro.com Backpatch through 9.4
2014-08-29Fix bug in compressed GIN data leaf page splitting code.Heikki Linnakangas
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.
2014-08-29Assorted message improvementsPeter Eisentraut
2014-08-28Add min and max aggregates for inet/cidr data types.Tom Lane
Haribabu Kommi, reviewed by Muhammad Asif Naeem
2014-08-29Revert "Allow units to be specified in relation option setting value."Fujii Masao
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.
2014-08-28Allow escaping of option values for options passed at connection start.Andres Freund
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.
2014-08-28Allow units to be specified in relation option setting value.Fujii Masao
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
2014-08-27Allow multibyte characters as escape in SIMILAR TO and SUBSTRING.Jeff Davis
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.
2014-08-27Fix FOR UPDATE NOWAIT on updated tuple chainsAlvaro Herrera
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 .
2014-08-27Add header comments to receivelog.h and streamutil.h.Fujii Masao
This commit also adds the include guards to those header files. Michael Paquier
2014-08-26Fix Var handling for security barrier viewsStephen Frost
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.
2014-08-26Fix typo in b34e37bfefbed1bf9396dde18f308d8b96fd176c.Robert Haas
Spotted by Peter Geoghegan.
2014-08-26Fix superuser concurrent refresh of matview owned by another.Kevin Grittner
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.
2014-08-26Mark IsBinaryUpgrade as PGDLLIMPORT to fix windows builds after a7ae1dc.Andres Freund
Author: David Rowley
2014-08-26Implement IF NOT EXISTS for CREATE SEQUENCE.Heikki Linnakangas
Fabrízio de Royes Mello
2014-08-26Show schema names in pg_dump verbose output.Heikki Linnakangas
Fabrízio de Royes Mello, reviewed by Michael Paquier
2014-08-25pg_upgrade: prevent automatic oid assignmentBruce Momjian
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.
2014-08-25rename macro isTempOrToastNamespace to isTempOrTempToastNamespaceBruce Momjian
Done for clarity
2014-08-25revert "Throw error for ALTER TABLE RESET of an invalid option"Bruce Momjian
Reverts commits 73d78e11a0f7183c80b93eefbbb6026fe9664015 and b0488e5c4fbfdce8acc989bdc17d9f0ec09ac281. Also reverts pg_upgrade changes.
2014-08-25Throw error for ALTER TABLE RESET of an invalid optionBruce Momjian
Also adjust pg_upgrade to not use this method for optional TOAST table creation. Patch by Fabrízio de Royes Mello
2014-08-25pg_ctl, pg_upgrade: allow multiple -o/-O options, append themBruce Momjian
Report by Pavel Raiskup
2014-08-25Revert XactLockTableWait context setup in conditional multixact waitAlvaro Herrera
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.
2014-08-25Use newly added InvalidCommandId instead of 0Alvaro Herrera
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.
2014-08-25DefineType: return base type OID, not its arrayAlvaro Herrera
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.
2014-08-25Have CREATE TABLE AS and REFRESH return an OIDAlvaro Herrera
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.
2014-08-25More psprintf goodnessAlvaro Herrera
2014-08-25Oops, forgot to "git add" one last changeAlvaro Herrera
2014-08-25Editorial review of SET UNLOGGEDAlvaro Herrera
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