summaryrefslogtreecommitdiff
path: root/src/backend/executor
AgeCommit message (Collapse)Author
2000-01-05Fix it's and its to be correct.Bruce Momjian
1999-12-29Improve subquery error message, now says "More than one tuple returnedBruce Momjian
by subselect used as expression."
1999-12-20Required catalog changes for extended LONG attribute storage.Jan Wieck
Jan
1999-12-20Clean up some minor gcc warnings.Tom Lane
1999-12-16Some changes to prepare for LONG attributes.Jan Wieck
Jan
1999-12-13New LDOUT makefile variable for QNX os.Bruce Momjian
1999-12-13aggregate(DISTINCT ...) works, per SQL spec.Tom Lane
Note this forces initdb because of change of Aggref node in stored rules.
1999-12-10Rename several destroy* functions/tags to drop*.Bruce Momjian
1999-12-09Make LD -r as macros that can be changed for QNX.Bruce Momjian
1999-11-24Rename heap_replace to heap_update.Bruce Momjian
1999-11-23Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jpBruce Momjian
1999-11-22Add system indexes to match all caches.Bruce Momjian
Make all system indexes unique. Make all cache loads use system indexes. Rename *rel to *relid in inheritance tables. Rename cache names to be clearer.
1999-11-15Clean up possible memory leakage in nodeSubplanTom Lane
1999-11-15Implement subselects in target lists. Also, relax requirement thatTom Lane
subselects can only appear on the righthand side of a binary operator. That's still true for quantified predicates like x = ANY (SELECT ...), but a subselect that delivers a single result can now appear anywhere in an expression. This is implemented by changing EXPR_SUBLINK sublinks to represent just the (SELECT ...) expression, without any 'left hand side' or combining operator --- so they're now more like EXISTS_SUBLINK. To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to. But the grammar will only generate one for a multiple-left-hand-side row expression.
1999-11-12Fix ExecSubPlan to handle nulls per the SQL spec --- it didn't combineTom Lane
nulls with non-nulls using proper three-valued boolean logic. Also clean up ExecQual to make it clearer that ExecQual *does* follow the SQL spec for boolean nulls. See '[BUGS] (null) != (null)' thread around 10/26/99 for more detail.
1999-11-07New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian
Fewer calls to nameout. Better use of RelationGetRelationName.
1999-11-04Make it possible to execute crashed CREATE/DROP commands again.Hiroshi Inoue
Now indexes of pg_class and pg_type are unique indexes and guarantee the uniqueness of correponding attributes. heap_create() was changed to take another boolean parameter which allows to postpone the creation of disk file. The name of rd_nonameunlinked was changed to rd_unlinked. It is used generally(not only for noname relations) now. Requires initdb.
1999-11-01Don't call ExecOpenIndices if pg_class relhasindex shows there are noTom Lane
indexes to open. Avoid unnecessary work in ExecCheckPerm, too.
1999-10-30Avoid duplicate ExecTypeFromTL() call in ExecInitJunkFilter() by passingTom Lane
in the TupleDesc that the caller already has (for call from ExecMain) or can make just as easily as ExecInitJunkFilter() can (for call from ExecAppend). Also, don't bother to build a junk filter for an INSERT operation that doesn't actually need one, which is the normal case.
1999-10-30Ooops ... 6.5 coding wasn't quite right anymore. Should learnTom Lane
never to commit without running regress tests...
1999-10-30Put back code in nodeAgg to generate a dummy all-nulls input tupleTom Lane
before calling execProject, when the outerPlan has returned zero tuples. I took this out under the mistaken impression that the input tuple couldn't be referenced by execProject if we weren't in GROUP BY mode. But it can, if we're in an UPDATE or DELETE...
1999-10-17Final stage of psort reconstruction work: replace psort.c withTom Lane
a generalized module 'tuplesort.c' that can sort either HeapTuples or IndexTuples, and is not tied to execution of a Sort node. Clean up memory leakages in sorting, and replace nbtsort.c's private implementation of mergesorting with calls to tuplesort.c.
1999-10-17Actually, nodeMergejoin shouldn't include psort.h at all...Tom Lane
1999-10-16nodeMergejoin was depending on an inclusion from psort.h...Tom Lane
1999-10-13Split 'BufFile' routines out of fd.c into a new module, buffile.c. ExtendTom Lane
BufFile so that it handles multi-segment temporary files transparently. This allows sorts and hashes to work with data exceeding 2Gig (or whatever the local limit on file size is). Change psort.c to use relative seeks instead of absolute seeks for backwards scanning, so that it won't fail when the data volume exceeds 2Gig.
1999-10-08Remove a no-longer-needed kluge for degenerate aggregate cases,Tom Lane
and update some comments.
1999-10-07Fix planner and rewriter to follow SQL semantics for tables that areTom Lane
mentioned in FROM but not elsewhere in the query: such tables should be joined over anyway. Aside from being more standards-compliant, this allows removal of some very ugly hacks for COUNT(*) processing. Also, allow HAVING clause without aggregate functions, since SQL does. Clean up CREATE RULE statement-list syntax the same way Bruce just fixed the main stmtmulti production. CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules; you will have to initdb if you have any rules.
1999-09-29This is part #1 for of the DEFERRED CONSTRAINT TRIGGER support.Jan Wieck
Implements the CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands. TODO: Generic builtin trigger procedures Automatic execution of appropriate CREATE CONSTRAINT... at CREATE TABLE Support of new trigger type in pg_dump Swapping of huge # of events to disk Jan
1999-09-28Fix nodeAgg coredump in case where lower-level plan hasTom Lane
an empty targetlist *and* fails to return any tuples, as will happen for example with 'SELECT COUNT(1) FROM table WHERE ...' if the where- clause selects no tuples. It's so nice to make a fix by diking out code, instead of adding more...
1999-09-26Modify nodeAgg.c so that no rows are returned for a GROUP BYTom Lane
with no input rows, per pghackers discussions around 7/22/99. Clean up a bunch of ugly coding while at it; remove redundant re-lookup of aggregate info at start of each new GROUP. Arrange to pfree intermediate values when they are pass-by-ref types, so that aggregates on pass-by-ref types no longer eat memory. This takes care of a couple of TODO items...
1999-09-26Implement constant-expression simplification per BernardTom Lane
Frankpitt, plus some improvements from yours truly. The simplifier depends on the proiscachable field of pg_proc to tell it whether a function is safe to pre-evaluate --- things like nextval() are not, for example. Update pg_proc.h to contain reasonable cacheability information; as of 6.5.* hardly any functions were marked cacheable. I may have erred too far in the other direction; see recent mail to pghackers for more info. This update does not force an initdb, exactly, but you won't see much benefit from the simplifier until you do one.
1999-09-24Several changes here, not very related but touching some of the same files.Tom Lane
* Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
1999-09-18Fix CASE bug identified by Keith Parks: CASE didn't reliablyTom Lane
treat a NULL condition result as FALSE. Clean up some bogus comments here and there, too.
1999-09-18Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane
additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
1999-08-25Revise implementation of SubLinks so that there is a consistent,Tom Lane
documented intepretation of the lefthand and oper fields. Fix a number of obscure problems while at it --- for example, the old code failed if the parser decided to insert a type-coercion function just below the operator of a SubLink. CAUTION: this will break stored rules that contain subplans. You may need to initdb.
1999-08-22Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane
and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
1999-08-21Major revision of sort-node handling: push knowledge of queryTom Lane
sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.
1999-08-12Add commentary to show that even though ExecInitIndexScan()Tom Lane
contains much code that looks like it will handle indexquals with the index key on either side of the operator, in fact indexquals must have the index key on the left because of limitations of the ScanKey machinery. Perhaps someone will be motivated to fix that someday...
1999-08-09> > Prevent sorting if result is already sortedBruce Momjian
> > > > was implemented by Jan Wieck. > > His work is for ascending order cases. > > > > Here is a patch to prevent sorting also in descending > > order cases. > > Because I had already changed _bt_first() to position > > backward correctly before v6.5,this patch would work. > > Hiroshi Inoue Inoue@tpf.co.jp
1999-07-19Rewrite parser's handling of INSERT ... SELECT so that processingTom Lane
of the SELECT part of the statement is just like a plain SELECT. All INSERT-specific processing happens after the SELECT parsing is done. This eliminates many problems, e.g. INSERT ... SELECT ... GROUP BY using the wrong column labels. Ensure that DEFAULT clauses are coerced to the target column type, whether or not stored clause produces the right type. Substantial cleanup of parser's array support.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-17Fix incorrect declaration of rtentry as 'ResTarget' where itTom Lane
should be 'RangeTblEntry' ; explain.c had copied the erroneous code.
1999-07-16Final cleanup.Bruce Momjian
1999-07-16Update #include cleanupsBruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-07-13Remove S*I comments from Stephan.Bruce Momjian
1999-07-11ExecReScanGroup() forgot to clear grpstate->grp_firstTuple,Tom Lane
thereby guaranteeing wrong results from a rescanned Group node.
1999-06-17Remove QUERY_LIMIT and documenation on same. Change _ALIGN to TYPEALIGNBruce Momjian
for Irix.
1999-06-12When targetlist is NULL, ExecTargetList was passing back aTom Lane
pointer to palloc'd but uninitialized memory. This is not cool; anyone looking at the returned 'tuple' would at best coredump and at worst behave in a bizarre and irreproducible way. Fix it to return a predictable value, namely a correctly-set-up palloc'd tuple containing zero attributes. I believe this fix is both safe and critical.