aboutsummaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAge
...
* Add copyObject logic for TruncateStmt and a few other utility-statementTom Lane2000-04-08
| | | | | | | | parse node types. This allows these statements to be placed in a plpgsql function. Also, see to it that statement types not handled by the copy logic will draw an appropriate elog(ERROR), instead of leaving a null pointer that will cause coredump later on. More utility statements could be added if anyone felt like turning the crank.
* Update create_rule manual page.Bruce Momjian2000-04-07
|
* Add transcendental math functions (sine, cosine, etc)Thomas G. Lockhart2000-04-07
| | | | | | | | | | | | | | | | Add a random number generator and seed setter (random(), SET SEED) Fix up the interval*float8 math to carry partial months into the time field. Add float8*interval so we have symmetry in the available math. Fix the parser and define.c to accept SQL92 types as field arguments. Fix the parser to accept SQL92 types for CREATE TYPE, etc. This is necessary to allow... Bit/varbit support in contrib/bit cleaned up to compile and load cleanly. Still needs some work before final release. Implement the "SOME" keyword as a synonym for "ANY" per SQL92. Implement ascii(text), ichar(int4), repeat(text,int4) to help support the ODBC driver. Enable the TRUNCATE() function mapping in the ODBC driver.
* Commebts & one check in EndEvalPlanQual().Vadim B. Mikheev2000-04-07
|
* Fix (I hope) resource leakage in EvalPlanQual: open subplans must beTom Lane2000-04-07
| | | | | properly shut down in EndPlan, else we fail to free buffers and so forth that they hold.
* Partial fix for EvalPlanQual bugs reported by Magnus Hagander, 3-Apr.Tom Lane2000-04-07
| | | | | | Ensure that outer tuple link needed for inner indexscan qual evaluation gets set in the EvalPlanQual case. This stops coredump, but we still have resource leaks due to failure to clean up EvalPlanQual properly...
* Allow vacuum of temporary tablesBruce Momjian2000-04-06
|
* Repair assert failure in tuple-chain-moving logic (introduced by yoursTom Lane2000-04-06
| | | | truly, I'm afraid).
* Actually, that still wasn't quite right. If we skip a query because ofTom Lane2000-04-04
| | | | | | xact abort state in pg_exec_query_dest, we should continue scanning the querytree list, on the off chance that one of the later queries in the string is COMMIT or ROLLBACK.
* Fix bug noted by Bruce: FETCH in an already-aborted transaction blockTom Lane2000-04-04
| | | | | | | | | | | would crash, due to premature invocation of SetQuerySnapshot(). Clean up problems with handling of multiple queries by splitting pg_parse_and_plan into two routines. The old code would not, for example, do the right thing with END; SELECT... submitted in one query string when it had been in transaction abort state, because it'd decide to skip planning the SELECT before it had executed the END. New arrangement is simpler and doesn't force caller to plan if only parse+rewrite is needed.
* When rewriting an aggregate introduced into WHERE, allow agg argument toTom Lane2000-04-04
| | | | | | | be an expression not just a simple Var, so long as only one table is referenced (so that code isn't really any more difficult than before). This whole thing is still fundamentally bogus, but at least we can accept a few more cases than before.
* Fix extremely nasty little bug observed when a sub-SELECT appears inTom Lane2000-04-04
| | | | | | | | | | | | | | | | | | | | WHERE in a place where it can be part of a nestloop inner indexqual. As the code stood, it put the same physical sub-Plan node into both indxqual and indxqualorig of the IndexScan plan node. That confused later processing in the optimizer (which expected that tracing the subPlan list would visit each subplan node exactly once), and would probably have blown up in the executor if the planner hadn't choked first. Fix by making the 'fixed' indexqual be a complete deep copy of the original indexqual, rather than trying to share nodes below the topmost operator node. This had further ramifications though, because we were making the aforesaid list of sub-Plan nodes during SS_process_sublinks which is run before construction of the 'fixed' indexqual, meaning that the copy of the sub-Plan didn't show up in that list. Fix by rearranging logic so that the sub-Plan list is built by the final set_plan_references pass, not in SS_process_sublinks. This may sound like a mess, but it's actually a good deal cleaner now than it was before, because we are no longer dependent on the assumption that planning will never make a copy of a sub-Plan node.
* Fix low-probability bug in relcache startup: write_irels wrote theTom Lane2000-03-31
| | | | | | | | | | pg_internal.init file in-place, which meant that if another backend started at about the same time, it might read the incomplete file. init_irels tries to guard against that, but I have now seen a crash due to reading bad data from a partly-written file. (This may indicate a kernel bug on my platform? Not sure.) Anyway, clearly the safest course is to write the new pg_internal.init file under a unique temporary filename, and rename it into place only after it's all written.
* Get rid of SetBufferWriteMode(), which was an accident waiting to happen.Tom Lane2000-03-31
| | | | | | | | In the event of an elog() while the mode was set to immediate write, there was no way for it to be set back to the normal delayed write. The mechanism was a waste of space and cycles anyway, since the only user was varsup.c, which could perfectly well call FlushBuffer directly. Now it does just that, and the notion of a write mode is gone.
* New coding for SET provoked a 'var might be used uninitialized' warningTom Lane2000-03-31
| | | | from gcc. Which wasn't actually a code bug, but I don't like warnings.
* Enable more flexible syntax for the SET command. Now allows single floats,Thomas G. Lockhart2000-03-30
| | | | | | single integers, and lists of names, without surrounding them with quotes. Remove all tokens which are defined as operators from ColID and ColLabel to avoid precedence confusion. Thanks to Tom Lane for catching this.
* Tweak indexscan cost estimation: round estimated # of tuples visited upTom Lane2000-03-30
| | | | | | | to next integer. Previously, if selectivity was small, we could compute very tiny scan cost on the basis of estimating that only 0.001 tuple would be fetched, which is silly. This naturally led to some rather silly plans...
* Change rules for interpreting date/time input to disallow 1 and 3 characterThomas G. Lockhart2000-03-29
| | | | years. Rejects dates like '0.085', which were accepted previously.
* Allow full type names in CREATE FUNCTION arguments and return type.Thomas G. Lockhart2000-03-27
| | | | | | | Move CREATE FUNCTION/WITH clause to end of statement to get around shift/reduce conflicts with type names containing "WITH". Add lots of tokens as allowed ColId's and/or ColLabel's, so this should be a complete set for the v7.0 release.
* nodeAgg has always been willing to accept an aggregate with a finalFuncTom Lane2000-03-26
| | | | | and only one transition state, but the CREATE AGGREGATE code rejected this combination.
* Updated user's guide to match new psql's output formatPeter Eisentraut2000-03-26
| | | | Fixed bug in createdb/alternative location
* transformCreateStmt should put Ident nodes, not ColumnDef nodes, intoTom Lane2000-03-24
| | | | | | | | | | | | | | | | | keys lists of Constraint nodes. This eliminates a type pun that would probably have caused trouble someday, and eliminates circular references in the parsetree that were causing trouble now. Also, change parser's uses of strcasecmp() to strcmp(). Since scan.l has downcased any unquoted identifier, it is never correct to check an identifier with strcasecmp() in the parser. For example, CREATE TABLE FOO (f1 int, UNIQUE("F1")); was accepted, which is wrong, and xlateSqlFunc did more than it should: select datetime(); ERROR: Function 'timestamp()' does not exist (good) select "DateTime"(); ERROR: Function 'timestamp()' does not exist (bad)
* Save a few cycles in simple cases: no need to call cost_sort() when thereTom Lane2000-03-24
| | | | is no presorted path to compare with.
* outfuncs.c was missing a print routine for Material plan nodes, leadingTom Lane2000-03-24
| | | | to trouble when trying to EXPLAIN VERBOSE a plan containing one.
* Rename bytea functions to not have upper-case letters in their names.Tom Lane2000-03-24
| | | | | | Clean up grotty coding in them, too. AFAICS from the CVS logs, these have been broken since Postgres95, so I'm not going to insist on an initdb to fix them now...
* A little further tweaking of the range-query selectivity logic:Tom Lane2000-03-23
| | | | | | | to avoid undue sensitivity to roundoff error, believe that a zero or slightly negative range estimate should represent a small positive selectivity, rather than falling back on a generic default estimate.
* >> 5. empty define that results in an empty but terminated line ( ; )Bruce Momjian2000-03-23
| | | | | | easy (maybe dumb) fix for 5 in attachment define.patch greetings, Andreas
* Hmm, absolute pathnames for the copy makes sense. I'll whip up thatBruce Momjian2000-03-23
| | | | | | | patch in a second. Should be sufficent to just make sure the first character is a '/', right? Ross J. Reedstrom
* Float-to-int conversion functions should return NULL when given NULLTom Lane2000-03-23
| | | | input, not throw a gratuitous elog().
* Remove no-longer-necessary restriction against uplevel correlation varsTom Lane2000-03-23
| | | | | outside WHERE clause. Fix a couple of places that didn't handle uplevel refs cleanly.
* Hack parse_coerce so it won't try to constant-fold the dummy ConstTom Lane2000-03-23
| | | | | nodes introduced by make_subplan(). It'd be better if we used a different node type for subplan result placeholders, but for now...
* ExecSubPlan needs to be able to cope with RelabelType nodes atop theTom Lane2000-03-23
| | | | Const placeholder nodes for subplan result values.
* If we cannot get a real estimate for the selectivity of a range query,Tom Lane2000-03-23
| | | | | | use a default value that's fairly small. We were generating a result of about 0.1, but I think 0.01 is probably better --- want to encourage use of an indexscan in this situation.
* Improve selectivity estimation involving string constants: pay attentionTom Lane2000-03-23
| | | | | to more than one character, and try to do the right thing in non-ASCII locales.
* Repair logic flaw in cost estimator: cost_nestloop() was estimating CPUTom Lane2000-03-22
| | | | | | | | | | | | | costs using the inner path's parent->rows count as the number of tuples processed per inner scan iteration. This is wrong when we are using an inner indexscan with indexquals based on join clauses, because the rows count in a Relation node reflects the selectivity of the restriction clauses for that rel only. Upshot was that if join clause was very selective, we'd drastically overestimate the true cost of the join. Fix is to calculate correct output-rows estimate for an inner indexscan when the IndexPath node is created and save it in the path node. Change of path node doesn't require initdb, since path nodes don't appear in saved rules.
* Add syntax for BIT() and BIT VARYING(), but no underlying implementationThomas G. Lockhart2000-03-21
| | | | | | is available yet. Remove redundant call to xlateSqlType() in the character type handling code.
* Restructure planning code so that preprocessing of targetlist and qualsTom Lane2000-03-21
| | | | | | | | | | | | | to simplify constant expressions and expand SubLink nodes into SubPlans is done in a separate routine subquery_planner() that calls union_planner(). We formerly did most of this work in query_planner(), but that's the wrong place because it may never see the real targetlist. Splitting union_planner into two routines also allows us to avoid redundant work when union_planner is invoked recursively for UNION and inheritance cases. Upshot is that it is now possible to do something like select float8(count(*)) / (select count(*) from int4_tbl) from int4_tbl group by f1; which has never worked before.
* Correct typo in error message.Tom Lane2000-03-21
|
* Reverse out BYTEA type coersion.Bruce Momjian2000-03-20
|
* Turn XLOG off (do not create log file).Vadim B. Mikheev2000-03-20
|
* Emit 'this operator is deprecated' warnings for ':' and ';'.Tom Lane2000-03-20
|
* Update for BYTEAOID.Bruce Momjian2000-03-20
|
* Add compatiblity information for bytea.Bruce Momjian2000-03-20
|
* Add FORCE keyword to ColIDHiroshi Inoue2000-03-20
|
* cash_words_out function truncated its output by 1 character due toTom Lane2000-03-19
| | | | incorrect use of StrNCpy.
* Several calls to StrNCpy incorrectly subtracted 1 from the length arg,Tom Lane2000-03-19
| | | | leading to postmaster accepting args 1 shorter than it had room for.
* Minor code rearrangement & doc improvement in eval_const_expressions().Tom Lane2000-03-19
|
* transformExpr() did the Wrong Thing if applied to a SubLink node thatTom Lane2000-03-19
| | | | | | | | | had already been transformed. This led to failure in examples like UPDATE table SET fld = (SELECT ...). Repair this, and revise the comments to explain that transformExpr has to be robust against this condition. Someday we might want to fix the callers so that transformExpr is never invoked on its own output, but that someday is not today.
* Another go-round with resolution of ambiguous functions and operators.Tom Lane2000-03-19
| | | | | | | | | | In function parsing, try for an actual function of the given name and input types before trying to interpret the function call as a type coercion request, rather than after. Before, a function that had the same name as a type and operated on a binary-compatible type wouldn't get invoked. Also, cross-pollinate between func_select_candidates and oper_select_candidates to ensure that they use as nearly the same resolution rules as possible. A few other minor code cleanups too.
* In can_coerce_type, verify that a possible type-coercion functionTom Lane2000-03-19
| | | | actually returns the type it is named for.