summaryrefslogtreecommitdiff
path: root/src/backend/executor
AgeCommit message (Collapse)Author
2000-03-23ExecSubPlan needs to be able to cope with RelabelType nodes atop theTom Lane
Const placeholder nodes for subplan result values.
2000-03-21Correct typo in error message.Tom Lane
2000-03-09Redo permissions-checking code so that it does the right thing at APPENDTom Lane
nodes. The former version failed to check permissions of relations that were referenced in second and later clauses of UNIONs, and it did not check permissions of tables referenced via inheritance.
2000-03-02Hmm, it seems nodeMaterial has been broken for a good long while;Tom Lane
closing a relcache entry more times than you open it is not cool.
2000-02-20Create a new expression node type RelabelType, which exists solely toTom Lane
represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
2000-02-18Implement reindex commandHiroshi Inoue
2000-02-15Carry column aliases from the parser frontend. Enables queries likeThomas G. Lockhart
SELECT a FROM t1 tx (a); Allow join syntax, including queries like SELECT * FROM t1 NATURAL JOIN t2; Update RTE structure to hold column aliases in an Attr structure.
2000-02-05Replace nth() calls in inner loops with traversal of the list viaTom Lane
lnext, to eliminate O(N^2) behavior with lots of indexquals.
2000-02-03Repair relation refcount leakage caused by SELECT FOR UPDATE.Tom Lane
2000-01-27Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is nowTom Lane
SELECT DISTINCT ON (expr [, expr ...]) targetlist ... and there is a check to make sure that the user didn't specify an ORDER BY that's incompatible with the DISTINCT operation. Reimplement nodeUnique and nodeGroup to use the proper datatype-specific equality function for each column being compared --- they used to do bitwise comparisons or convert the data to text strings and strcmp(). (To add insult to injury, they'd look up the conversion functions once for each tuple...) Parse/plan representation of DISTINCT is now a list of SortClause nodes. initdb forced by querytree change...
2000-01-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
2000-01-19Fix handling of NULL constraint conditions: per SQL92 spec, a NULL resultTom Lane
from a constraint condition does not violate the constraint (cf. discussion on pghackers 12/9/99). Implemented by adding a parameter to ExecQual, specifying whether to return TRUE or FALSE when the qual result is really NULL in three-valued boolean logic. Currently, ExecRelCheck is the only caller that asks for TRUE, but if we find any other places that have the wrong response to NULL, it'll be easy to fix them.
2000-01-17setheapoverride() is history. Uses replaced with CommandCounterIncrement()Tom Lane
where necessary --- several of them didn't really need it, though. tqual-checking macros simplified accordingly.
2000-01-17Update subquery error message.Bruce Momjian
2000-01-10Make number of args to a function configurable.Bruce Momjian
2000-01-09Another round of planner/optimizer work. This is just restructuring andTom Lane
code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
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.