aboutsummaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAge
* 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.
* Improve error message wording in unary_op_error() --- suggest thatTom Lane2000-03-18
| | | | | | problem could be lack of parentheses. This addresses cases like X UserOp UserOp Y, which will be parsed as (X UserOp) UserOp Y, whereas what likely was wanted was X UserOp (UserOp Y).
* Clean up minor compiler warnings.Tom Lane2000-03-18
|
* Modify lexing of multi-char operators per pghackers discussion aroundTom Lane2000-03-18
| | | | | | | | | | 16-Mar-00: trailing + or - is not part of the operator unless the operator also contains characters not present in SQL92-defined operators. This solves the 'X=-Y' problem without unduly constraining users' choice of operator names --- in particular, no existing Postgres operator names become invalid. Also, remove processing of // comments, as agreed in the same thread.
* Just noticed that the grammar actually has no provision for '+' as aTom Lane2000-03-18
| | | | | prefix operator :-(. Bad enough that we have no implementation of unary plus, but at least with this fix the grammar will take it.
* Add translation of timespan to interval.Bruce Momjian2000-03-18
|
* Add safety check on expression nesting depth. Default value is set byTom Lane2000-03-17
| | | | a config.h #define, and the runtime value can be controlled via SET.
* Fix a bunch of minor portability problems and maybe-bugs revealed byTom Lane2000-03-17
| | | | | | running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
* Support full POSIX-style time zone: EST+3, PST-3, etc.Thomas G. Lockhart2000-03-16
| | | | | | We probably support a superset of the spec, but I don't have the spec to confirm this. Update regression tests to include tests for this format.
* Turns out that Mazurkiewicz's gripe about 'function inheritance' isTom Lane2000-03-16
| | | | | | actually a type-coercion problem. If you have a function defined on class A, and class B inherits from A, then the function ought to work on class B as well --- but coerce_type didn't know that. Now it does.
* Fix some (more) problems with subselects in rules. Rewriter failed toTom Lane2000-03-16
| | | | | | | mark query as having subselects if a subselect was added from a rule WHERE condition (as opposed to a rule action). Also, fix adjustment of varlevelsup so that it actually has some prospect of working when inserting an expression containing a subselect into a subquery.
* Hi,Bruce Momjian2000-03-16
| | | | | | | | | | small changes in formatting.c code (better memory usage ...etc.) and better to_char's cache (will fastly for more to_char()s in one query). (It is probably end of to_char() development in 7.0 cycle.) Karel
* Update comment obsoleted by Thomas's latest fixes.Tom Lane2000-03-15
|
* Tweak GROUP BY so that it will still accept result-column names, but onlyTom Lane2000-03-15
| | | | | | | | | | after trying to resolve the item as an input-column name. This allows us to be compliant with the SQL92 spec for queries that fall within the spec, while still accepting the same out-of-spec queries as 6.5 did. You'll only lose if there is an output column name that is the same as an input column name, but doesn't refer to the same value. 7.0 will interpret such a GROUP BY spec differently than 6.5 did. No way around that, because 6.5 was clearly not spec compliant.
* Fix busted TRANSLATE() code --- it coredumped due to pfree()'ing theTom Lane2000-03-15
| | | | wrong pointer.
* Remove another incorrect UserAbortTransactionBlock() call.Tom Lane2000-03-15
|
* Remove gratuitous and incorrect begin/commit transaction calls inTom Lane2000-03-15
| | | | | | | | CREATE DB/DROP DB. If you didn't think they were wrong, try what happens when you compile with -DCLOBBER_FREED_MEMORY --- database name displayed in error messages is trashed, because transaction abort freed it. Also, remove trailing periods in error messages, per our prevailing style.
* Add 'datetime' -> 'timestamp' conversion to xlateSqlFunc() to easeTom Lane2000-03-15
| | | | | the pain of updating apps to 7.0. Should we also translate some of the 'datetime_foo' functions that exist in 6.* ?
* Cache fmgr lookup data for index's getnext() function in IndexScanDesc,Tom Lane2000-03-14
| | | | | so that the fmgr lookup only has to happen once per index scan and not once per tuple. Seems to save 5% or so of CPU time for an indexscan.
* Implement column aliases on views "CREATE VIEW name (collist)".Thomas G. Lockhart2000-03-14
| | | | | | | | | | | | | | | | | | Implement TIME WITH TIME ZONE type (timetz internal type). Remap length() for character strings to CHAR_LENGTH() for SQL92 and to remove the ambiguity with geometric length() functions. Keep length() for character strings for backward compatibility. Shrink stored views by removing internal column name list from visible rte. Implement min(), max() for time and timetz data types. Implement conversion of TIME to INTERVAL. Implement abs(), mod(), fac() for the int8 data type. Rename some math functions to generic names: round(), sqrt(), cbrt(), pow(), etc. Rename NUMERIC power() function to pow(). Fix int2 factorial to calculate result in int4. Enhance the Oracle compatibility function translate() to work with string arguments (from Edwin Ramirez). Modify pg_proc system table to remove OID holes.
* Marginal performance improvement in LockBuffer --- calculate addressTom Lane2000-03-14
| | | | | | of BufferLocks[] entry just once. Seems to save 10% or so of the routine's runtime, which'd not be worth worrying about if it weren't such a hotspot.
* > I have improved the System V semaphore emulation of the QNX4 port.Bruce Momjian2000-03-14
| | | | | | | | | | Please > apply the attached patch to > > backend/port/qnx4 > > Andreas Kardos >