aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
Commit message (Collapse)AuthorAge
* Back-patch fix for a typo that unintentionally disabled backward scansTom Lane2005-02-10
| | | | for all SPI-created cursors.
* Check that aggregate creator has the right to execute the transitionTom Lane2005-01-27
| | | | functions of the aggregate, at both aggregate creation and execution times.
* Hashed LEFT JOIN would miss outer tuples with no inner match if the joinTom Lane2004-09-17
| | | | | | was large enough to be batched and the tuples fell into a batch where there were no inner tuples at all. Thanks to Xiaoyu Wang for finding a test case that exposed this long-standing bug.
* Back-patch fix to disallow BEGIN/COMMIT/ROLLBACK inside SQL functions.Tom Lane2004-09-06
| | | | | Not sure why this isn't causing serious problems in some simple tests, but it definitely isn't going to do anything desirable...
* Test HAVING condition before computing targetlist of an Aggregate node.Tom Lane2004-07-10
| | | | | | | This is required by SQL spec to avoid failures in cases like SELECT sum(win)/sum(lose) FROM ... GROUP BY ... HAVING sum(lose) > 0; AFAICT we have gotten this wrong since day one. Kudos to Holger Jakobs for being the first to notice.
* Still another place to make the world safe for zero-column tables.Tom Lane2004-04-07
| | | | Per example from Jiang Wei.
* Repair memory leakage introduced into the non-hashed aggregate case byTom Lane2004-03-13
| | | | | | | 7.4 rewrite for hashed aggregate support. If the transition data type is pass-by-reference, the transValue must be pfreed when starting a new group boundary, else we have a one-value-per-group leakage. Thanks to Rae Steining for providing a reproducible test case.
* Junkfilter logic to force a projection step during SELECT INTO was tooTom Lane2004-03-02
| | | | | simplistic; it recognized SELECT * FROM but not SELECT * FROM LIMIT. Per bug report from Jeff Bohmer.
* Fix oversight in optimization that avoids an unnecessary projection stepTom Lane2004-01-22
| | | | | | when scanning a table that we need all the columns from. In case of SELECT INTO, we have to check that the hasoids flag matches the desired output type, too. Per report from Mike Mascari.
* Avoid running out of memory during hash_create, by not passing aTom Lane2003-12-30
| | | | | number-of-buckets that exceeds the size we actually plan to allow the hash table to grow to. Per trouble report from Sean Shanny.
* Use a shutdown callback to clear setArgsValid in a FuncExprState that isTom Lane2003-12-18
| | | | | evaluating a set-valued function. This fixes some additional problems with rescanning partially-evaluated SRFs.
* Ensure set-returning functions in the targetlist of a plan node will beTom Lane2003-12-18
| | | | | | shut down cleanly if the plan node is ReScanned before the SRFs are run to completion. This fixes the problem for SQL-language functions, but still need work on functions using the SRF_XXX() macros.
* Band-aid solution for problems with SubPlans used in hash join clauses,Tom Lane2003-11-25
| | | | | | | | | | per report from Andrew Holm-Hansen. The difficulty arises from the fact that the planner allowed a Hash node's hashkeys to share substructure with the parent HashJoin node's hashclauses, plus some rather bizarre choices about who initializes what during executor startup. A cleaner but more invasive solution is to not store hashkeys separately in the plan tree at all, but let the HashJoin node deconstruct hashclauses during executor startup. I plan to fix it that way in HEAD.
* Back out makeNode() patch to fix gcc 3.3.1 warning.Bruce Momjian2003-10-13
|
* Use makeNode() to allocate structures that have to be cast to Node *,Bruce Momjian2003-10-12
| | | | | | rather than allocating them on the stack. Fixes complaint from gcc 3.3.1.
* Back out -fstrict-aliasing void* casting.Bruce Momjian2003-10-11
|
* This patch will stop gcc from issuing warnings about type-punned objectsBruce Momjian2003-10-11
| | | | | | | when -fstrict-aliasing is turned on, as it is in the latest gcc when you use -O2 Andrew Dunstan
* Repair RI trigger visibility problems (this time for sure ;-)) per recentTom Lane2003-10-01
| | | | | | | discussion on pgsql-hackers: in READ COMMITTED mode we just have to force a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have to run the scan under a current snapshot and then complain if any rows would be updated/deleted that are not visible in the transaction snapshot.
* I discovered that TupleDescGetAttInMetadata and BuildTupleFromCStringsBruce Momjian2003-09-29
| | | | | | | don't deal well with tuples having dropped columns. The attached fixes the issue. Please apply. Joe Conway
* Fix tid scan evaluation of non-constant TID values; can't try to do itTom Lane2003-09-26
| | | | during ExecInitTidScan, because the rest of the executor isn't ready.
* Make the world safe (more or less) for dropped columns in plpgsql rowtypes.Tom Lane2003-09-25
|
* tlist_matches_tupdesc() needs to defend itself against dropped columns.Tom Lane2003-09-25
|
* Get rid of ReferentialIntegritySnapshotOverride by extending Executor APITom Lane2003-09-25
| | | | | | to allow es_snapshot to be set to SnapshotNow rather than a query snapshot. This solves a bug reported by Wade Klaver, wherein triggers fired as a result of RI cascade updates could misbehave.
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-25
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* Repair some REINDEX problems per recent discussions. The relcache isTom Lane2003-09-24
| | | | | | | | | | | | | now able to cope with assigning new relfilenode values to nailed-in-cache indexes, so they can be reindexed using the fully crash-safe method. This leaves only shared system indexes as special cases. Remove the 'index deactivation' code, since it provides no useful protection in the shared- index case. Require reindexing of shared indexes to be done in standalone mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes) now prevents using indexes for lookups, but does not disable index updates. It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs can be done without a standalone backend for all cases except shared catalogs.
* _SPI_cursor_operation forgot to check for failure return fromTom Lane2003-09-23
| | | | _SPI_begin_call. Per gripe from Tomasz Myrta.
* Since SPI_modifytuple's natts argument is the number of attributes to beTom Lane2003-09-16
| | | | changed, it should allow a zero value (implying no changes to make).
* Fix LISTEN/NOTIFY race condition reported by Gavin Sherry. While aTom Lane2003-09-15
| | | | | | | | | | | | | | | really general fix might be difficult, I believe the only case where AtCommit_Notify could see an uncommitted tuple is where the other guy has just unlistened and not yet committed. The best solution seems to be to just skip updating that tuple, on the assumption that the other guy does not want to hear about the notification anyway. This is not perfect --- if the other guy rolls back his unlisten instead of committing, then he really should have gotten this notify. But to do that, we'd have to wait to see if he commits or not, or make UNLISTEN hold exclusive lock on pg_listener until commit. Either of these answers is deadlock-prone, not to mention horrible for interactive performance. Do it this way for now. (What happened to that project to do LISTEN/NOTIFY in memory with no table, anyway?)
* OK, some of these syntax errors should be given other codes.Peter Eisentraut2003-09-15
|
* Some "feature not supported" errors are better syntax errors, because thePeter Eisentraut2003-09-09
| | | | | feature they complain about isn't a feature or cannot be implemented without definitional changes.
* Tweak processing of multiple-index-scan plans to reduce overhead whenTom Lane2003-08-22
| | | | | | | handling many-way scans: instead of re-evaluating all prior indexscan quals to see if a tuple has been fetched more than once, use a hash table indexed by tuple CTID. But fall back to the old way if the hash table grows to exceed SortMem.
* Improve dynahash.c's API so that caller can specify the comparison functionTom Lane2003-08-19
| | | | | | | | | | | | | as well as the hash function (formerly the comparison function was hardwired as memcmp()). This makes it possible to eliminate the special-purpose hashtable management code in execGrouping.c in favor of using dynahash to manage tuple hashtables; which is a win because dynahash knows how to expand a hashtable when the original size estimate was too small, whereas the special-purpose code was too stupid to do that. (See recent gripe from Stephan Szabo about poor performance when hash table size estimate is way off.) Free side benefit: when using string_hash, the default comparison function is now strncmp() instead of memcmp(). This should eliminate some part of the overhead associated with larger NAMEDATALEN values.
* Fix ARRAY[] construct so that in multidimensional case, elements canTom Lane2003-08-17
| | | | | | | | be anything yielding an array of the proper kind, not only sub-ARRAY[] constructs; do subscript checking at runtime not parse time. Also, adjust array_cat to make array || array comply with the SQL99 spec. Joe Conway
* Code cleanup inspired by recent resname bug report (doesn't fix the bugTom Lane2003-08-11
| | | | | | | | yet, though). Avoid using nth() to fetch tlist entries; provide a common routine get_tle_by_resno() to search a tlist for a particular resno. This replaces a couple uses of nth() and a dozen hand-coded search loops. Also, replace a few uses of nth(length-1, list) with llast().
* Another pgindent run with updated typedefs.Bruce Momjian2003-08-08
|
* Fix nasty little order-of-operations bug in _SPI_cursor_operation.Tom Lane2003-08-08
| | | | Per report from Mendola Gaetano.
* Suppress unused-variable warnings when building without Asserts.Tom Lane2003-08-08
|
* Rename fields of DestReceiver to avoid collisions with (ill-considered)Tom Lane2003-08-06
| | | | macros in some platforms' sys/socket.h.
* Fix some copyright notices that weren't updated. Improve copyright toolTom Lane2003-08-04
| | | | so it won't miss 'em again.
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* Adjust 'permission denied' messages to be more useful and consistent.Tom Lane2003-08-01
|
* Cause ARRAY[] construct to return a NULL array, rather than raising anTom Lane2003-07-30
| | | | | | error, if any input element is NULL. This is not what we ultimately want, but until arrays can have NULL elements, it will have to do. Patch from Joe Conway.
* Add error stack traceback support for SQL-language functions.Tom Lane2003-07-28
|
* A visit from the message-style police ...Tom Lane2003-07-28
|
* Error message editing in backend/executor.Tom Lane2003-07-21
|
* Aggregates can be polymorphic, using polymorphic implementation functions.Tom Lane2003-07-01
| | | | | | It also works to create a non-polymorphic aggregate from polymorphic functions, should you want to do that. Regression test added, docs still lacking. By Joe Conway, with some kibitzing from Tom Lane.
* SQL functions can have arguments and results declared ANYARRAY orTom Lane2003-07-01
| | | | | | | | ANYELEMENT. The effect is to postpone typechecking of the function body until runtime. Documentation is still lacking. Original patch by Joe Conway, modified to postpone type checking by Tom Lane.
* Support expressions of the form 'scalar op ANY (array)' andTom Lane2003-06-29
| | | | | | | | | | 'scalar op ALL (array)', where the operator is applied between the lefthand scalar and each element of the array. The operator must yield boolean; the result of the construct is the OR or AND of the per-element results, respectively. Original coding by Joe Conway, after an idea of Peter's. Rewritten by Tom to keep the implementation strictly separate from subqueries.
* Create real array comparison functions (that use the element datatype'sTom Lane2003-06-27
| | | | | | | | | | | | | | | | comparison functions), replacing the highly bogus bitwise array_eq. Create a btree index opclass for ANYARRAY --- it is now possible to create indexes on array columns. Arrange to cache the results of catalog lookups across multiple array operations, instead of repeating the lookups on every call. Add string_to_array and array_to_string functions. Remove singleton_array, array_accum, array_assign, and array_subscript functions, since these were for proof-of-concept and not intended to become supported functions. Minor adjustments to behavior in some corner cases with empty or zero-dimensional arrays. Joe Conway (with some editorializing by Tom Lane).