aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Improve readability and error messages in pg_backup_start_time.Robert Haas2012-06-14
| | | | Gurjeet Singh, with corrections by me.
* New SQL functons pg_backup_in_progress() and pg_backup_start_time()Robert Haas2012-06-14
| | | | | Darold Gilles, reviewed by Gabriele Bartolini and others, rebased by Marco Nenciarini. Stylistic cleanup and OID fixes by me.
* During transaction cleanup, release locks before deleting files.Robert Haas2012-06-14
| | | | | | | | There's no need to hold onto the locks until the files are needed, and by doing it this way, we reduce the impact on other backends who may be awaiting locks we hold. Noah Misch
* Add new function log_newpage_buffer.Robert Haas2012-06-14
| | | | | | | | When I implemented the ginbuildempty() function as part of implementing unlogged tables, I falsified the note in the header comment for log_newpage. Although we could fix that up by changing the comment, it seems cleaner to add a new function which is specifically intended to handle this case. So do that.
* Remove misplaced sanity check from heap_create().Robert Haas2012-06-14
| | | | | | | | | | | | | Even when allow_system_table_mods is not set, we allow creation of any type of SQL object in pg_catalog, except for relations. And you can get relations into pg_catalog, too, by initially creating them in some other schema and then moving them with ALTER .. SET SCHEMA. So this restriction, which prevents relations (only) from being created in pg_catalog directly, is fairly pointless. If we need a safety mechanism for this, it should be placed further upstream, so that it affects all SQL objects uniformly, and picks up both CREATE and SET SCHEMA. For now, just rip it out, per discussion with Tom Lane.
* Remove RELKIND_UNCATALOGED.Robert Haas2012-06-14
| | | | | | | This may have been important at some point in the past, but it no longer does anything useful. Review by Tom Lane.
* Make \conninfo print SSL information.Robert Haas2012-06-14
| | | | Alastair Turner, per suggestion from Bruce Momjian.
* Add 9.2 branch to git_changelog's list.Tom Lane2012-06-13
|
* Flesh out RELEASE_CHANGES instructions for branching in git.Tom Lane2012-06-13
| | | | We have this info in the wiki, but it should be here too.
* Stamp library minor versions for 9.3.Tom Lane2012-06-13
| | | | | | This includes fixing the MSVC copy of ecpg/preproc's version info, which seems to have been overlooked repeatedly. Can't we fix that so there are not two copies??
* Stamp HEAD as 9.3devel.Tom Lane2012-06-13
| | | | Let the hacking begin ...
* Revisit error message details for JSON input parsing.Tom Lane2012-06-13
| | | | | | | | | Instead of identifying error locations only by line number (which could be entirely unhelpful with long input lines), provide a fragment of the input text too, placing this info in a new CONTEXT entry. Make the error detail messages conform more closely to style guidelines, fix failure to expose some of them for translation, ensure compiler can check formats against supplied parameters.
* Revert "Reduce checkpoints and WAL traffic on low activity database server"Tom Lane2012-06-13
| | | | | | | | | | | | | This reverts commit 18fb9d8d21a28caddb72c7ffbdd7b96d52ff9724. Per discussion, it does not seem like a good idea to allow committed changes to go un-checkpointed indefinitely, as could happen in a low-traffic server; that makes us entirely reliant on the WAL stream with no redundancy that might aid data recovery in case of disk failure. This re-introduces the original problem of hot-standby setups generating a small continuing stream of WAL traffic even when idle, but there are other ways to address that without compromising crash recovery, so we'll revisit that issue in a future release cycle.
* Deprecate use of GLOBAL and LOCAL in temp table creation.Tom Lane2012-06-13
| | | | | | | | | | | | | Aside from adjusting the documentation to say that these are deprecated, we now report a warning (not an error) for use of GLOBAL, since it seems fairly likely that we might change that to request SQL-spec-compliant temp table behavior in the foreseeable future. Although our handling of LOCAL is equally nonstandard, there is no evident interest in ever implementing SQL modules, and furthermore some other products interpret LOCAL as behaving the same way we do. So no expectation of change and no warning for LOCAL; but it still seems a good idea to deprecate writing it. Noah Misch
* Support Linux's oom_score_adj API as well as the older oom_adj API.Tom Lane2012-06-13
| | | | | | | | | The simplest way to handle this is just to copy-and-paste the relevant code block in fork_process.c, so that's what I did. (It's possible that something more complicated would be useful to packagers who want to work with either the old or the new API; but at this point the number of such people is rapidly approaching zero, so let's just get the minimal thing done.) Update relevant documentation as well.
* Improve documentation of postgres -C optionPeter Eisentraut2012-06-13
| | | | | | Clarify help (s/return/print/), and explain that this option is for use by other programs, not for user-facing use (it does not print units).
* Minor code review for json.c.Tom Lane2012-06-12
| | | | | Improve commenting, conform to project style for use of ++ etc. No functional changes.
* Mark JSON error detail messages for translation.Robert Haas2012-06-12
| | | | Per gripe from Tom Lane.
* Ensure pg_ctl behaves sanely when data directory is not specified.Tom Lane2012-06-11
| | | | | | | | | | | | | | Commit aaa6e1def292cdacb6b27088898793b1b879fedf introduced multiple hazards in the case where pg_ctl is executed with neither a -D switch nor any PGDATA environment variable. It would dump core on machines which are unforgiving about printf("%s", NULL), or failing that possibly give a rather unhelpful complaint about being unable to execute "postgres -C", rather than the logically prior complaint about not being told where the data directory is. Edmund Horner's report suggests that there is another, Windows-specific hazard here, but I'm not the person to fix that; it would in any case only be significant when trying to use a config-only PGDATA pointer.
* Fix pg_dump output to a named tar-file archive.Tom Lane2012-06-11
| | | | | | | | "pg_dump -Ft -f filename ..." got broken by my recent commit 4317e0246c645f60c39e6572644cff1cb03b4c65, which I fear I only tested in the output-to-stdout variant. Report and fix by Muhammad Asif Naeem.
* pg_receivexlog: Rename option --dir to --directoryPeter Eisentraut2012-06-12
| | | | | | | | getopt_long() allows abbreviating long options, so we might as well give the option the full name, and users can abbreviate it how they like. Do some general polishing of the --help output at the same time.
* Prevent non-streaming replication connections from being selected sync slaveMagnus Hagander2012-06-11
| | | | | | | | | | | | This prevents a pg_basebackup backup session that just does a base backup (no xlog involved at all) from becoming the synchronous slave and thus blocking all access while it runs. Also fixes the problem when a higher priority slave shows up it would become the sync standby before it has reached the STREAMING state, by making sure we can only switch to a walsender that's actually STREAMING. Fujii Masao
* Revert behaviour of -x/--xlog to 9.1 semanticsMagnus Hagander2012-06-11
| | | | | | | | To replace it, add -X/--xlog-method that allows the specification of fetch or stream. Do this to avoid unnecessary backwards-incompatiblity. Spotted and suggested by Peter Eisentraut.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Update pgindent install instructions and update typedef list.Bruce Momjian2012-06-10
|
* Fix pg_basebackup/pg_receivexlog for floating point timestampsMagnus Hagander2012-06-10
| | | | | | | Since the replication protocol deals with TimestampTz, we need to care for the floating point case as well in the frontend tools. Fujii Masao, with changes from Magnus Hagander
* Error message capitalization fixMagnus Hagander2012-06-10
|
* Make include files work without having to include other ones firstPeter Eisentraut2012-06-10
|
* Revert error message on GLOBAL/LOCAL pending further discussionSimon Riggs2012-06-10
|
* Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implementedSimon Riggs2012-06-09
|
* Fix bug in early startup of Hot Standby with subtransactions.Simon Riggs2012-06-08
| | | | | | | | | | When HS startup is deferred because of overflowed subtransactions, ensure that we re-initialize KnownAssignedXids for when both existing and incoming snapshots have non-zero qualifying xids. Fixes bug #6661 reported by Valentine Gogichashvili. Analysis and fix by Andres Freund
* When using libpq URI syntax, error out on invalid parameter names.Robert Haas2012-06-08
| | | | Dan Farina
* Scan the buffer pool just once, not once per fork, during relation drop.Tom Lane2012-06-07
| | | | | | | | This provides a speedup of about 4X when NBuffers is large enough. There is also a useful reduction in sinval traffic, since we only do CacheInvalidateSmgr() once not once per fork. Simon Riggs, reviewed and somewhat revised by Tom Lane
* Message style improvementsPeter Eisentraut2012-06-07
|
* Do unlocked prechecks in bufmgr.c loops that scan the whole buffer pool.Tom Lane2012-06-07
| | | | | | | | | | | | | | | | | | | | DropRelFileNodeBuffers, DropDatabaseBuffers, FlushRelationBuffers, and FlushDatabaseBuffers have to scan the whole shared_buffers pool because we have no index structure that would find the target buffers any more efficiently than that. This gets expensive with large NBuffers. We can shave some cycles from these loops by prechecking to see if the current buffer is interesting before we acquire the buffer header lock. Ordinarily such a test would be unsafe, but in these cases it should be safe because we are already assuming that the caller holds a lock that prevents any new target pages from being loaded into the buffer pool concurrently. Therefore, no buffer tag should be changing to a value of interest, only away from a value of interest. So a false negative match is impossible, while a false positive is safe because we'll recheck after acquiring the buffer lock. Initial testing says that this speeds these loops by a factor of 2X to 3X on common Intel hardware. Patch for DropRelFileNodeBuffers by Jeff Janes (based on an idea of Heikki's); extended to the remaining sequential scans by Tom Lane
* Wake WALSender to reduce data loss at failover for async commit.Simon Riggs2012-06-07
| | | | | | | | | WALSender now woken up after each background flush by WALwriter, avoiding multi-second replication delay for an all-async commit workload. Replication delay reduced from 7s with default settings to 200ms and often much less, allowing significantly reduced data loss at failover. Andres Freund and Simon Riggs
* Fix more crash-safe visibility map bugs, and improve comments.Robert Haas2012-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | In lazy_scan_heap, we could issue bogus warnings about incorrect information in the visibility map, because we checked the visibility map bit before locking the heap page, creating a race condition. Fix by rechecking the visibility map bit before we complain. Rejigger some related logic so that we rely on the possibly-outdated all_visible_according_to_vm value as little as possible. In heap_multi_insert, it's not safe to clear the visibility map bit before beginning the critical section. The visibility map is not crash-safe unless we treat clearing the bit as a critical operation. Specifically, if the transaction were to error out after we set the bit and before entering the critical section, we could end up writing the heap page to disk (with the bit cleared) and crashing before the visibility map page made it to disk. That would be bad. heap_insert has this correct, but somehow the order of operations got rearranged when heap_multi_insert was added. Also, add some more comments to visibilitymap_test, lazy_scan_heap, and IndexOnlyNext, expounding on concurrency issues. Per extensive code review by Andres Freund, and further review by Tom Lane, who also made the original report about the bogus warnings.
* Use strerror(errno) instead of %mMagnus Hagander2012-06-05
| | | | Found by Fujii Masao
* Fix bogus handling of control characters in json_lex_string().Tom Lane2012-06-04
| | | | | | | | | The original coding misbehaved if "char" is signed, and also made the extremely poor decision to print control characters literally when trying to complain about them. Report and patch by Shigeru Hanada. In passing, also fix core dump risk in report_parse_error() should the parse state be something other than what it expects.
* Fix memory leaks in failure paths in buildACLCommands and parseAclItem.Tom Lane2012-06-03
| | | | | | | | | This is currently only cosmetic, since all the call sites just curl up and die in event of a failure return. It might be important for some future use-case, though, and in any case it quiets warnings from the clang static analyzer (as reported by Anna Zaks). Josh Kupershmidt
* Avoid early reuse of btree pages, causing incorrect query results.Simon Riggs2012-06-01
| | | | | | | | | | | | | When we allowed read-only transactions to skip assigning XIDs we introduced the possibility that a fully deleted btree page could be reused. This broke the index link sequence which could then lead to indexscans silently returning fewer rows than would have been correct. The actual incidence of silent errors from this is thought to be very low because of the exact workload required and locking pre-conditions. Fix is to remove pages only if index page opaque->btpo.xact precedes RecentGlobalXmin. Noah Misch, reviewed by Simon Riggs
* After any checkpoint, close all smgr files handles in bgwriterSimon Riggs2012-06-01
|
* Checkpointer starts before bgwriter to avoid missing fsync requests.Simon Riggs2012-06-01
| | | | Noted while testing Hot Standby startup.
* Provide interim statistics while in mid-checkpoint.Simon Riggs2012-06-01
| | | | | | | Re-implements similar functionality in 9.1 and previously which was removed during split of checkpointer and bgwriter. Requested/spotted by Magnus Hagander
* Stamp 9.2beta2.REL9_2_BETA2Tom Lane2012-05-31
|
* Improve comment for GetStableLatestTransactionId().Tom Lane2012-05-31
|
* Only throw recovery conflicts when InHotStandby. Bug fix to recentSimon Riggs2012-05-31
| | | | | | patch to allow Index Only Scans on Hot Standby. Bug report from Jaime Casanova
* Update time zone data files to tzdata release 2012c.Tom Lane2012-05-31
| | | | | | DST law changes in Antarctica, Armenia, Chile, Cuba, Falkland Islands, Gaza, Haiti, Hebron, Morocco, Syria, Tokelau Islands. Historical corrections for Canada.
* Force PL and range-type support functions to be owned by a superuser.Tom Lane2012-05-30
| | | | | | | | | | | | | | | We allow non-superusers to create procedural languages (with restrictions) and range datatypes. Previously, the automatically-created support functions for these objects ended up owned by the creating user. This represents a rather considerable security hazard, because the owning user might be able to alter a support function's definition in such a way as to crash the server, inject trojan-horse SQL code, or even execute arbitrary C code directly. It appears that right now the only actually exploitable problem is the infinite-recursion bug fixed in the previous patch for CVE-2012-2655. However, it's not hard to imagine that future additions of more ALTER FUNCTION capability might unintentionally open up new hazards. To forestall future problems, cause these support functions to be owned by the bootstrap superuser, not the user creating the parent object.
* Ignore SECURITY DEFINER and SET attributes for a PL's call handler.Tom Lane2012-05-30
| | | | | | | | | | | | | | | | | | | | | | It's not very sensible to set such attributes on a handler function; but if one were to do so, fmgr.c went into infinite recursion because it would call fmgr_security_definer instead of the handler function proper. There is no way for fmgr_security_definer to know that it ought to call the handler and not the original function referenced by the FmgrInfo's fn_oid, so it tries to do the latter, causing the whole process to start over again. Ordinarily such misconfiguration of a procedural language's handler could be written off as superuser error. However, because we allow non-superuser database owners to create procedural languages and the handler for such a language becomes owned by the database owner, it is possible for a database owner to crash the backend, which ideally shouldn't be possible without superuser privileges. In 9.2 and up we will adjust things so that the handler functions are always owned by superusers, but in existing branches this is a minor security fix. Problem noted by Noah Misch (after several of us had failed to detect it :-(). This is CVE-2012-2655.