- 19 7月, 2011 2 次提交
-
-
由 Peter Eisentraut 提交于
-
由 Tom Lane 提交于
This is more SQL-spec-compliant, more easily extensible, and better performing than the old method of inventing special variables. Pavel Stehule, reviewed by Shigeru Hanada and David Wheeler
-
- 18 7月, 2011 1 次提交
-
-
由 Robert Haas 提交于
When an AccessShareLock, RowShareLock, or RowExclusiveLock is requested on an unshared database relation, and we can verify that no conflicting locks can possibly be present, record the lock in a per-backend queue, stored within the PGPROC, rather than in the primary lock table. This eliminates a great deal of contention on the lock manager LWLocks. This patch also refactors the interface between GetLockStatusData() and pg_lock_status() to be a bit more abstract, so that we don't rely so heavily on the lock manager's internal representation details. The new fast path lock structures don't have a LOCK or PROCLOCK structure to return, so we mustn't depend on that for purposes of listing outstanding locks. Review by Jeff Davis.
-
- 13 7月, 2011 1 次提交
-
-
由 Tom Lane 提交于
Regular aggregate functions in combination with, or within the arguments of, window functions are OK per spec; they have the semantics that the aggregate output rows are computed and then we run the window functions over that row set. (Thus, this combination is not really useful unless there's a GROUP BY so that more than one aggregate output row is possible.) The case without GROUP BY could fail, as recently reported by Jeff Davis, because sloppy construction of the Agg node's targetlist resulted in extra references to possibly-ungrouped Vars appearing outside the aggregate function calls themselves. See the added regression test case for an example. Fixing this requires modifying the API of flatten_tlist and its underlying function pull_var_clause. I chose to make pull_var_clause's API for aggregates identical to what it was already doing for placeholders, since the useful behaviors turn out to be the same (error, report node as-is, or recurse into it). I also tightened the error checking in this area a bit: if it was ever valid to see an uplevel Var, Aggref, or PlaceHolderVar here, that was a long time ago, so complain instead of ignoring them. Backpatch into 9.1. The failure exists in 8.4 and 9.0 as well, but seeing that it only occurs in a basically-useless corner case, it doesn't seem worth the risks of changing a function API in a minor release. There might be third-party code using pull_var_clause.
-
- 08 7月, 2011 1 次提交
-
-
由 Peter Eisentraut 提交于
-
- 07 7月, 2011 1 次提交
-
-
由 Heikki Linnakangas 提交于
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
-
- 05 7月, 2011 2 次提交
-
-
由 Peter Eisentraut 提交于
-
由 Alvaro Herrera 提交于
This lets us stop including rel.h into execnodes.h, which is a widely used header.
-
- 04 7月, 2011 2 次提交
-
-
由 Simon Riggs 提交于
-
由 Robert Haas 提交于
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.
-
- 30 6月, 2011 2 次提交
-
-
由 Alvaro Herrera 提交于
This means that they can initially be added to a large existing table without checking its initial contents, but new tuples must comply to them; a separate pass invoked by ALTER TABLE / VALIDATE can verify existing data and ensure it complies with the constraint, at which point it is marked validated and becomes a normal part of the table ecosystem. An non-validated CHECK constraint is ignored in the planner for constraint_exclusion purposes; when validated, cached plans are recomputed so that partitioning starts working right away. This patch also enables domains to have unvalidated CHECK constraints attached to them as well by way of ALTER DOMAIN / ADD CONSTRAINT / NOT VALID, which can later be validated with ALTER DOMAIN / VALIDATE CONSTRAINT. Thanks to Thom Brown, Dean Rasheed and Jaime Casanova for the various reviews, and Robert Hass for documentation wording improvement suggestions. This patch was sponsored by Enova Financial.
-
由 Tom Lane 提交于
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 29c4ad98, 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.
-
- 29 6月, 2011 1 次提交
-
-
由 Peter Eisentraut 提交于
We had previously (af26857a) established the U.S. spellings as standard.
-
- 23 6月, 2011 2 次提交
-
-
由 Tom Lane 提交于
-
- 22 6月, 2011 3 次提交
-
-
由 Robert Haas 提交于
It's not entirely stable. Per suggestion from Josh Kupershmidt.
-
由 Robert Haas 提交于
Josh Kupershmidt
-
由 Peter Eisentraut 提交于
-
- 21 6月, 2011 3 次提交
-
-
由 Heikki Linnakangas 提交于
used when max_prepared_transactions=0, for the recent changes in the test case.
-
由 Heikki Linnakangas 提交于
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
-
由 Tom Lane 提交于
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.
-
- 19 6月, 2011 1 次提交
-
-
由 Peter Eisentraut 提交于
-
- 10 6月, 2011 1 次提交
-
-
由 Bruce Momjian 提交于
-
- 09 6月, 2011 1 次提交
-
-
由 Tom Lane 提交于
This use-case was broken in commit 529cb267 of 2010-10-21, in which I commented "For the moment, we just forbid such matching. We might later wish to insert an automatic downcast to the underlying array type, but such a change should also change matching of domains to ANYELEMENT for consistency". We still lack consensus about what to do with ANYELEMENT; but not matching ANYARRAY is a clear loss of functionality compared to prior releases, so let's go ahead and make that happen. Per complaint from Regina Obe and extensive subsequent discussion.
-
- 07 6月, 2011 1 次提交
-
-
由 Tom Lane 提交于
Since the original implementation of CTEs only allowed them in SELECT queries, the rule rewriter did not expect to find any CTEs in statements being rewritten by ON INSERT/UPDATE/DELETE rules. We had dealt with this to some extent but the code was still several bricks shy of a load, as illustrated in bug #6051 from Jehan-Guillaume de Rorthais. In particular, we have to be able to copy CTEs from the original query's cteList into that of a rule action, in case the rule action references the CTE (which it pretty much always will). This also implies we were doing things in the wrong order in RewriteQuery: we have to recursively rewrite the CTE queries before expanding the main query, so that we have the rewritten queries available to copy. There are unpleasant limitations yet to resolve here, but at least we now throw understandable FEATURE_NOT_SUPPORTED errors for them instead of just failing with bizarre implementation-dependent errors. In particular, we can't handle propagating the same CTE into multiple post-rewrite queries (because then the CTE would be evaluated multiple times), and we can't cope with conflicts between CTE names in the original query and in the rule actions.
-
- 06 6月, 2011 1 次提交
-
-
由 Tom Lane 提交于
This avoids an Assert failure when we try to use ordinary index fetches while checking for exclusion conflicts. Per report from Noah Misch. No need for back-patch because the Assert wasn't there before 9.1.
-
- 04 6月, 2011 1 次提交
-
-
由 Tom Lane 提交于
The existence of a btree opclass accepting composite types caused us to assume that every composite type is sortable. This isn't true of course; we need to check if the column types are all sortable. There was logic for this for the case of array comparison (ie, check that the element type is sortable), but we missed the point for rowtypes. Per Teodor's report of an ANALYZE failure for an unsortable composite type. Rather than just add some more ad-hoc logic for this, I moved knowledge of the issue into typcache.c. The typcache will now only report out array_eq, record_cmp, and friends as usable operators if the array or composite type will work with those functions. Unfortunately we don't have enough info to do this for anonymous RECORD types; in that case, just assume it will work, and take the runtime failure as before if it doesn't. This patch might be a candidate for back-patching at some point, but given the lack of complaints from the field, I'd rather just test it in HEAD for now. Note: most of the places touched in this patch will need further work when we get around to supporting hashing of record types.
-
- 03 6月, 2011 1 次提交
-
-
由 Tom Lane 提交于
We need this now because we allow domains over arrays, and we'll probably allow domains over composites pretty soon, which makes the problem even more obvious. Although domains over arrays also exist in previous versions, this does not need to be back-patched, because the coding used in older versions successfully "looked through" domains over arrays. The problem is exposed by not treating a domain as having a typelem. Problem identified by Noah Misch, though I did not use his patch, since it would require additional work to handle domains over composites that way. This approach is more future-proof.
-
- 21 5月, 2011 2 次提交
-
-
由 Heikki Linnakangas 提交于
Noah Misch
-
由 Peter Eisentraut 提交于
-
- 19 5月, 2011 1 次提交
-
-
由 Peter Eisentraut 提交于
-
- 16 5月, 2011 1 次提交
-
-
由 Andrew Dunstan 提交于
-
- 06 5月, 2011 1 次提交
-
-
由 Magnus Hagander 提交于
-
- 28 4月, 2011 1 次提交
-
-
由 Andrew Dunstan 提交于
The style is set to "printf" for backwards compatibility everywhere except on Windows, where it is set to "gnu_printf", which eliminates hundreds of false error messages from modern versions of gcc arising from %m and %ll{d,u} formats.
-
- 26 4月, 2011 3 次提交
-
-
由 Peter Eisentraut 提交于
Added a new option --extra-install to pg_regress to arrange installing the respective contrib directory into the temporary installation. This is currently not yet supported for Windows MSVC builds. Updated the .gitignore files for contrib modules to ignore the leftovers of a temp-install check run. Changed the exit status of "make check" in a pgxs build (which still does nothing) to 0 from 1. Added "make check" in contrib to top-level "make check-world".
-
由 Andrew Dunstan 提交于
Per Tom Lane's suggestion about my gripe about occasional errors noticed on the buildfarm.
-
由 Andrew Dunstan 提交于
Mostly to do with macro redefinitions or object signedness.
-
- 25 4月, 2011 1 次提交
-
-
由 Robert Haas 提交于
Kevin Grittner, per discussion of bug #5989
-
- 24 4月, 2011 2 次提交
-
-
由 Tom Lane 提交于
Teach the program and script to deal with OID-array referencing columns, which we now have several of. Also, modify the recommended usage process to specify that the program should be run against the regression database rather than template1. This lets it find numerous joins that cannot be found in template1 because the relevant catalogs are entirely empty. Together these changes add seventeen formerly-missed cases to the oidjoins regression test.
-
由 Tom Lane 提交于
-