aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Tag 9.1beta3.REL9_1_BETA3Tom Lane2011-07-07
|
* There's a small window wherein a transaction is committed but not yetHeikki Linnakangas2011-07-08
| | | | | | | | on the finished list, and we shouldn't flag it as a potential conflict if so. We can also skip adding a doomed transaction to the list of possible conflicts because we know it won't commit. Dan Ports and Kevin Grittner.
* SSI has a race condition, where the order of commit sequence numbers ofHeikki Linnakangas2011-07-07
| | | | | | | | | | | | | | | transactions might not match the order the work done in those transactions become visible to others. The logic in SSI, however, assumed that it does. Fix that by having two sequence numbers for each serializable transaction, one taken before a transaction becomes visible to others, and one after it. This is easier than trying to make the the transition totally atomic, which would require holding ProcArrayLock and SerializableXactHashLock at the same time. By using prepareSeqNo instead of commitSeqNo in a few places where commit sequence numbers are compared, we can make those comparisons err on the safe side when we don't know for sure which committed first. Per analysis by Kevin Grittner and Dan Ports, but this approach to fix it is different from the original patch.
* Reclassify replication-related GUC variables as "master" and "standby".Tom Lane2011-07-07
| | | | | | | Per discussion, this structure seems more understandable than what was there before. Make config.sgml and postgresql.conf.sample agree. In passing do a bit of editorial work on the variable descriptions.
* Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.Robert Haas2011-07-07
| | | | | | | | The value when BLCKSZ = 8192 is unchanged, but with larger-than-normal block sizes we might need to crank things back a bit, as we'll have more entries per page than normal in that case. Kevin Grittner
* Finish disabling reduced-lock-levels-for-DDL feature.Tom Lane2011-07-07
| | | | | Previous patch only covered the ALTER TABLE changes, not changes in other commands; and it neglected to revert the documentation changes.
* Fix a bug with SSI and prepared transactions:Heikki Linnakangas2011-07-07
| | | | | | | | | | | | | | | | | If there's a dangerous structure T0 ---> T1 ---> T2, and T2 commits first, we need to abort something. If T2 commits before both conflicts appear, then it should be caught by OnConflict_CheckForSerializationFailure. If both conflicts appear before T2 commits, it should be caught by PreCommit_CheckForSerializationFailure. But that is actually run when T2 *prepares*. Fix that in OnConflict_CheckForSerializationFailure, by treating a prepared T2 as if it committed already. This is mostly a problem for prepared transactions, which are in prepared state for some time, but also for regular transactions because they also go through the prepared state in the SSI code for a short moment when they're committed. Kevin Grittner and Dan Ports
* Remove assumptions that not-equals operators cannot be in any opclass.Tom Lane2011-07-06
| | | | | | | | | | | | | | | get_op_btree_interpretation assumed this in order to save some duplication of code, but it's not true in general anymore because we added <> support to btree_gist. (We still assume it for btree opclasses, though.) Also, essentially the same logic was baked into predtest.c. Get rid of that duplication by generalizing get_op_btree_interpretation so that it can be used by predtest.c. Per bug report from Denis de Bernardy and investigation by Jeff Davis, though I didn't use Jeff's patch exactly as-is. Back-patch to 9.1; we do not support this usage before that.
* Call FDW validator functions even when the options list is empty.Tom Lane2011-07-05
| | | | | | | This is useful since a validator might want to require certain options to be provided. The passed array is an empty text array in this case. Per suggestion by Laurenz Albe, though this is not quite his patch.
* Message style improvements of errmsg_internal() callsPeter Eisentraut2011-07-05
|
* Fix psql's counting of script file line numbers during COPY.Tom Lane2011-07-05
| | | | | | | | handleCopyIn incremented pset.lineno for each line of COPY data read from a file. This is correct when reading from the current script file (i.e., we are doing COPY FROM STDIN followed by in-line data), but it's wrong if the data is coming from some other file. Per bug #6083 from Steve Haslam. Back-patch to all supported versions.
* Message style tweaksPeter Eisentraut2011-07-05
|
* Back-patch Fix bat file quoting of %ENV from commit 19b7fac8.Andrew Dunstan2011-07-04
|
* Alter test results to comply with new ALTER TABLE behaviour.Simon Riggs2011-07-04
|
* Reset ALTER TABLE lock levels to AccessExclusiveLock in all cases.Simon Riggs2011-07-04
| | | | | Locks on inheritance parent remain at lower level, as they were before. Remove entry from 9.1 release notes.
* Put comments on the installable procedural languages.Tom Lane2011-07-03
| | | | Per suggestion from Josh Kupershmidt.
* Fix bugs in relpersistence handling during table creation.Robert Haas2011-07-03
| | | | | | | | | | | | | | | | | Unlike the relistemp field which it replaced, relpersistence must be set correctly quite early during the table creation process, as we rely on it quite early on for a number of purposes, including security checks. Normally, this is set based on whether the user enters CREATE TABLE, CREATE UNLOGGED TABLE, or CREATE TEMPORARY TABLE, but a relation may also be made implicitly temporary by creating it in pg_temp. This patch fixes the handling of that case, and also disables creation of unlogged tables in temporary tablespace (such table indeed skip WAL-logging, but we reject an explicit specification) and creation of relations in the temporary schemas of other sessions (which is not very sensible, and didn't work right anyway). Report by Amit Khandekar.
* Make distprep and *clean build targets recurse into all subdirectories.Tom Lane2011-07-03
| | | | | | | | | | | | | | | | | | | Certain subdirectories do not get built if corresponding options are not selected at configure time. However, "make distprep" should visit such directories anyway, so that constructing derived files to be included in the tarball happens without requiring all configure options to be given in the tarball build script. Likewise, it's better if cleanup actions unconditionally visit all directories (for example, this ensures proper cleanup if someone has done a manual make in such a subdirectory). To handle this, set up a convention that subdirectories that are conditionally included in SUBDIRS should be added to ALWAYS_SUBDIRS instead when they are excluded. Back-patch to 9.1, so that plpython's spiexceptions.h will get provided in 9.1 tarballs. There don't appear to be any instances where distprep actions got missed in previous releases, and anyway this fix requires gmake 3.80 so we don't want to apply it before 9.1.
* Unify spelling of "canceled", "canceling", "cancellation"Peter Eisentraut2011-07-02
| | | | | We had previously (af26857a2775e7ceb0916155e931008c2116632f) established the U.S. spellings as standard.
* Add some strings that were not marked for translationPeter Eisentraut2011-07-02
|
* Restore correct btree preprocessing of "indexedcol IS NULL" conditions.Tom Lane2011-06-29
| | | | | | | | | | | | Such a condition is unsatisfiable in combination with any other type of btree-indexable condition (since we assume btree operators are always strict). 8.3 and 8.4 had an explicit test for this, which I removed in commit 29c4ad98293e3c5cb3fcdd413a3f4904efff8762, mistakenly thinking that the case would be subsumed by the more general handling of IS (NOT) NULL added in that patch. Put it back, and improve the comments about it, and add a regression test case. Per bug #6079 from Renat Nasyrov, and analysis by Dean Rasheed.
* Move the PredicateLockRelation() call from nodeSeqscan.c to heapam.c. It'sHeikki Linnakangas2011-06-29
| | | | | | | | | | | | | | | | | | | | more consistent that way, since all the other PredicateLock* calls are made in various heapam.c and index AM functions. The call in nodeSeqscan.c was unnecessarily aggressive anyway, there's no need to try to lock the relation every time a tuple is fetched, it's enough to do it once. This has the user-visible effect that if a seq scan is initialized in the executor, but never executed, we now acquire the predicate lock on the heap relation anyway. We could avoid that by taking the lock on the first heap_getnext() call instead, but it doesn't seem worth the trouble given that it feels more natural to do it in heap_beginscan(). Also, remove the retail PredicateLockTuple() calls from heap_getnext(). In a seqscan, started with heap_begin(), we're holding a whole-relation predicate lock on the heap so there's no need to lock the tuples individually. Kevin Grittner and me
* Grab predicate locks on matching tuples in a lossy bitmap heap scan.Heikki Linnakangas2011-06-29
| | | | | | Non-lossy case was already handled correctly. Kevin Grittner
* Protect pg_stat_reset_shared() against NULL inputMagnus Hagander2011-06-29
| | | | Per bug #6082, reported by Steve Haslam
* Reduce impact of btree page reuse on Hot Standby by fixing off-by-1 error.Simon Riggs2011-06-27
| | | | | | | | | WAL records of type XLOG_BTREE_REUSE_PAGE were generated using a latestRemovedXid one higher than actually needed because xid used was page opaque->btpo.xact rather than an actually removed xid. Noticed on an otherwise quiet system by Noah Misch. Noah Misch and Simon Riggs
* Undo overly enthusiastic de-const-ification.Tom Lane2011-06-22
| | | | | | | s/const//g wasn't exactly what I was suggesting here ... parameter declarations of the form "const structtype *param" are good and useful, so put those occurrences back. Likewise, avoid casting away the const in a "const void *" parameter.
* Add missing -I switch for VPATH builds.Tom Lane2011-06-22
| | | | Per bug #6073 from Hartmut Raschick.
* Fix symlink for errcodes.h so it works in VPATH builds from tarballs.Tom Lane2011-06-22
| | | | | | | backend/Makefile was treating errcodes.h as a header always generated during build, but actually it's a header provided in tarballs. Hence, must use the absolute-symlink recipe, not the relative-symlink one. Per bug #6072 from Hartmut Raschick.
* Remove pointless const qualifiers from function arguments in the SSI code.Heikki Linnakangas2011-06-22
| | | | | | | As Tom Lane pointed out, "const Relation foo" doesn't guarantee that you can't modify the data the "foo" pointer points to. It just means that you can't change the pointer to point to something else within the function, which is not very useful.
* Minor editing for README-SSI.Tom Lane2011-06-21
| | | | | Fix some grammatical issues, try to clarify a couple of proofs, make the terminology more consistent.
* Message style and spelling improvementsPeter Eisentraut2011-06-22
|
* Adjust the alternative expected output file for prepared_xacts test case,Heikki Linnakangas2011-06-21
| | | | | used when max_prepared_transactions=0, for the recent changes in the test case.
* Fix bug in PreCommit_CheckForSerializationFailure. A transaction that hasHeikki Linnakangas2011-06-21
| | | | | | | | | | | | already been marked as PREPARED cannot be killed. Kill the current transaction instead. One of the prepared_xacts regression tests actually hits this bug. I removed the anomaly from the duplicate-gids test so that it fails in the intended way, and added a new test to check serialization failures with a prepared transaction. Dan Ports
* Fix bug introduced by recent SSI patch to merge ROLLED_BACK andHeikki Linnakangas2011-06-21
| | | | | | | | | | MARKED_FOR_DEATH flags into one. We still need the ROLLED_BACK flag to mark transactions that are in the process of being rolled back. To be precise, ROLLED_BACK now means that a transaction has already been discounted from the count of transactions with the oldest xmin, but not yet removed from the list of active transactions. Dan Ports
* Fix thinko in previous patch for optimizing EXISTS-within-EXISTS.Tom Lane2011-06-20
| | | | | | | | | | | | | | | | | | | | | | When recursing after an optimization in pull_up_sublinks_qual_recurse, the available_rels value passed down must include only the relations that are in the righthand side of the new SEMI or ANTI join; it's incorrect to pull up a sub-select that refers to other relations, as seen in the added test case. Per report from BangarRaju Vadapalli. While at it, rethink the idea of recursing below a NOT EXISTS. That is essentially the same situation as pulling up ANY/EXISTS sub-selects that are in the ON clause of an outer join, and it has the same disadvantage: we'd force the two joins to be evaluated according to the syntactic nesting order, because the lower join will most likely not be able to commute with the ANTI join. That could result in having to form a rather large join product, whereas the handling of a correlated subselect is not quite that dumb. So until we can handle those cases better, #ifdef NOT_USED that case. (I think it's okay to pull up in the EXISTS/ANY cases, because SEMI joins aren't so inflexible about ordering.) Back-patch to 8.4, same as for previous patch in this area. Fortunately that patch hadn't made it into any shipped releases yet.
* Fix thinko in previous patch to always update pg_class.reltuples/relpages.Tom Lane2011-06-19
| | | | | | I mis-simplified the test where ANALYZE decided if it could get away without doing anything: under the new regime, that's never allowed. Per bug #6068 from Jeff Janes. Back-patch to 8.4, just like previous patch.
* Capitalization fixesPeter Eisentraut2011-06-19
|
* Obtain table locks as soon as practical during pg_dump.Tom Lane2011-06-17
| | | | | | | | | | For some reason, when we (I) added table lock acquisition to pg_dump, we didn't think about making it happen as soon as possible after the start of the transaction. What with subsequent additions, there was actually quite a lot going on before we got around to that; which sort of defeats the purpose. Rearrange the order of calls in dumpSchema() to close the risk window as much as we easily can. Back-patch to all supported branches.
* Add overflow checks to int4 and int8 versions of generate_series().Robert Haas2011-06-17
| | | | | | | | | The previous code went into an infinite loop after overflow. In fact, an overflow is not really an error; it just means that the current value is the last one we need to return. So, just arrange to stop immediately when overflow is detected. Back-patch all the way.
* Fix crash in CREATE UNLOGGED TABLE.Robert Haas2011-06-17
| | | | | | | | | The code that created the init fork neglected to make sure that the relation was open at the smgr level before attempting to invoke smgr. This didn't happen every time; only when the relcache entry was rebuilt along the way. Per report from Garick Hamlin.
* Update README-SSI. Add a section to describe the "dangerous structure" thatHeikki Linnakangas2011-06-16
| | | | | | | | SSI is based on, as well as the optimizations about relative commit times and read-only transactions. Plus a bunch of other misc fixes and improvements. Dan Ports
* Fix typoAlvaro Herrera2011-06-16
|
* Remove another no-longer-needed inclusion of predicate.h.Tom Lane2011-06-16
|
* pgindent run of recent SSI changes. Also, remove an unnecessary #include.Heikki Linnakangas2011-06-16
| | | | Kevin Grittner
* Respect Hot Standby controls while recycling btree index pages.Simon Riggs2011-06-16
| | | | | | | | | | | | | | Btree pages were recycled after VACUUM deletes all records on a page and then a subsequent VACUUM occurs after the RecentXmin horizon is reached. Using RecentXmin meant that we did not respond correctly to the user controls provide to avoid Hot Standby conflicts and so spurious conflicts could be generated in some workload combinations. We now reuse pages only when we reach RecentGlobalXmin, which can be much later in the presence of long running queries and is also controlled by vacuum_defer_cleanup_age and hot_standby_feedback. Noah Misch and Simon Riggs
* Use single quotes in preference to double quotes for protecting pathnames.Tom Lane2011-06-15
| | | | | | Per recommendation from Peter. Neither choice is bulletproof, but this is the existing style and it does help prevent unexpected environment variable substitution.
* Rework parsing of ConstraintAttributeSpec to improve NOT VALID handling.Tom Lane2011-06-15
| | | | | | | | | | | The initial commit of the ALTER TABLE ADD FOREIGN KEY NOT VALID feature failed to support labeling such constraints as deferrable. The best fix for this seems to be to fold NOT VALID into ConstraintAttributeSpec. That's a bit more general than the documented syntax, but it allows better-targeted syntax error messages. In addition, do some mostly-but-not-entirely-cosmetic code review for the whole NOT VALID patch.
* Fix failure to account for memory used by tuplestore_putvalues().Tom Lane2011-06-15
| | | | | | | | | | | | | | | | | | | This oversight could result in a tuplestore using much more than the intended amount of memory. It would only happen in a code path that loaded a tuplestore via tuplestore_putvalues(), and many of those won't emit huge amounts of data; but cases such as holdable cursors and plpgsql's RETURN NEXT command could have the problem. The fix ensures that the tuplestore will switch to write-to-disk mode when it overruns work_mem. The potential overrun was finite, because we would still count the space used by the tuple pointer array, so the tuplestore code would eventually flip into write-to-disk mode anyway. When storing wide tuples we would go far past the expected work_mem usage before that happened; but this may account for the lack of prior reports. Back-patch to 8.4, where tuplestore_putvalues was introduced. Per bug #6061 from Yann Delorme.
* Fix oversights in pg_basebackup's -z (compression) option.Tom Lane2011-06-15
| | | | | | | | | | The short-form -z switch didn't work, for lack of telling getopt_long about it; and even if specified long-form, it failed to do anything, because the various tests elsewhere in the file would take Z_DEFAULT_COMPRESSION (which is -1) as meaning "don't compress". Per bug #6060 from Shigehiro Honda, though I editorialized on his patch a bit.
* The rolled-back flag on serializable xacts was pointless and redundant withHeikki Linnakangas2011-06-15
| | | | | | | | the marked-for-death flag. It was only set for a fleeting moment while a transaction was being cleaned up at rollback. All the places that checked for the rolled-back flag should also check the marked-for-death flag, as both flags mean that the transaction will roll back. I also renamed the marked-for-death into "doomed", which is a lot shorter name.