summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
AgeCommit message (Collapse)Author
2007-01-22Put back planner's ability to cache the results of mergejoinscansel(),Tom Lane
which I had removed in the first cut of the EquivalenceClass rewrite to simplify that patch a little. But it's still important --- in a four-way join problem mergejoinscansel() was eating about 40% of the planning time according to gprof. Also, improve the EquivalenceClass code to re-use join RestrictInfos rather than generating fresh ones for each join considered. This saves some memory space but more importantly improves the effectiveness of caching planning info in RestrictInfos.
2007-01-20Simplify pg_am representation of ordering-capable access methods:Tom Lane
provide just a boolean 'amcanorder', instead of fields that specify the sort operator strategy numbers. We have decided to require ordering-capable AMs to use btree-compatible strategy numbers, so the old fields are overkill (and indeed misleading about what's allowed).
2007-01-20Make setseed() return void, rather than an int4 without any use. PerNeil Conway
pgsql-patches discussion of September 20, 2006. Bump the catversion.
2007-01-20Refactor planner's pathkeys data structure to create a separate, explicitTom Lane
representation of equivalence classes of variables. This is an extensive rewrite, but it brings a number of benefits: * planner no longer fails in the presence of "incomplete" operator families that don't offer operators for every possible combination of datatypes. * avoid generating and then discarding redundant equality clauses. * remove bogus assumption that derived equalities always use operators named "=". * mergejoins can work with a variety of sort orders (e.g., descending) now, instead of tying each mergejoinable operator to exactly one sort order. * better recognition of redundant sort columns. * can make use of equalities appearing underneath an outer join.
2007-01-20Remove remains of old depend target.Peter Eisentraut
2007-01-20Fix xmlconcat by properly merging the XML declarations. Add aggregatePeter Eisentraut
function xmlagg.
2007-01-20Add missing copyright blurb, make ruleutils.c use the standard layoutNeil Conway
for its header comment.
2007-01-19Add support for converting binary values (i.e. bytea) into xml values,Peter Eisentraut
with new GUC parameter "xmlbinary" that controls the output encoding, as per SQL/XML standard.
2007-01-18Clean up encoding issues in the xml type: In text mode, encodingPeter Eisentraut
declarations are ignored and removed, in binary mode they are honored as specified by the XML standard.
2007-01-16Implement width_bucket() for the float8 data type.Neil Conway
The implementation is somewhat ugly logic-wise, but I don't see an easy way to make it more concise. When writing this, I noticed that my previous implementation of width_bucket() doesn't handle NaN correctly: postgres=# select width_bucket('NaN', 1, 5, 5); width_bucket -------------- 6 (1 row) AFAICS SQL:2003 does not define a NaN value, so it doesn't address how width_bucket() should behave here. The patch changes width_bucket() so that ereport(ERROR) is raised if NaN is specified for the operand or the lower or upper bounds to width_bucket(). For float8, NaN is disallowed for any of the floating-point inputs, and +/- infinity is disallowed for the histogram bounds (but allowed for the operand). Update docs and regression tests, bump the catversion.
2007-01-14Fix reverse compilation of IS DOCUMENT expression.Peter Eisentraut
2007-01-14Add support for xmlval IS DOCUMENT expression.Peter Eisentraut
2007-01-12Fix handling of CC (century) format spec in to_date/to_char. According toTom Lane
standard convention the 21st century runs from 2001-2100, not 2000-2099, so make it work like that. Per bug #2885 from Akio Iwaasa. Backpatch to 8.2, but no further, since this is really a definitional change; users of older branches are probably more interested in stability.
2007-01-12Use XML output escaping also in XMLFOREST.Peter Eisentraut
2007-01-12Allow for arbitrary data types as content in XMLELEMENT. The originalPeter Eisentraut
coercion to type xml was a mistake. Escape values so they are valid XML character data.
2007-01-10Use libxml's xmlwriter API for producing XML elements, instead of doingPeter Eisentraut
our own printing dance. This does a better job of quoting and escaping the values.
2007-01-09Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LASTTom Lane
per-column options for btree indexes. The planner's support for this is still pretty rudimentary; it does not yet know how to plan mergejoins with nondefault ordering options. The documentation is pretty rudimentary, too. I'll work on improving that stuff later. Note incompatible change from prior behavior: ORDER BY ... USING will now be rejected if the operator is not a less-than or greater-than member of some btree opclass. This prevents less-than-sane behavior if an operator that doesn't actually define a proper sort ordering is selected.
2007-01-07Some fine-tuning of xmlpi in corner cases:Peter Eisentraut
- correct error codes - do syntax checks in correct order - strip leading spaces of argument
2007-01-07Allow XML fragment to contain a XML declaration. For that, we need a smallPeter Eisentraut
hand-crafted parser for the XML declaration, because libxml doesn't seem to allow this.
2007-01-06Apply fix so pow() and exp() ERANGE is used only if result is not 0.Bruce Momjian
2007-01-06Replace xmlroot with a properly functioning version that parses the value,Peter Eisentraut
sets the items, and serializes the value back (rather than adding an arbitrary number of XML preambles as before). The libxml memory management via palloc had to be disabled because it crashes when libxml tries to access memory that was helpfully freed earlier by PostgreSQL. This needs further thought.
2007-01-06Check for ERANGE in exp() as well.Bruce Momjian
Improve release docs for ecpg regression tests.
2007-01-06Improve dpow() check for ERANGE overflow for HPPA.Bruce Momjian
2007-01-06Put back ERANGE test in dpow(). There are platforms that need this,Tom Lane
like my HPPA ...
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2007-01-05Update float dpow() comment about whick platforms had issues with Nan.Bruce Momjian
Stefan Kaltenbrunner
2007-01-04Simplify assignment of Inf for pow Nan (don't worry about the sign).Bruce Momjian
2007-01-03Fix regex_fixed_prefix() to cope reasonably well with regex patterns of theTom Lane
form '^(foo)$'. Before, these could never be optimized into indexscans. The recent changes to make psql and pg_dump generate such patterns (for \d commands and -t and related switches, respectively) therefore represented a big performance hit for people with large pg_class catalogs, as seen in recent gripe from Erik Jones. While at it, be more paranoid about case-sensitivity checking in multibyte encodings, and fix some other corner cases in which a regex might be interpreted too liberally.
2007-01-03Update pow() tests to check for both errno==EDOM _and_ result==Nan, andBruce Momjian
document why this happens. Remove exp() errno check because not needed.
2007-01-03Fix erroneous error tests in pow/exp.Tom Lane
2007-01-03Attempt to return proper overflow/underflow messages for platforms thatBruce Momjian
only return Nan and set errno for pow/exp overflow/underflow.
2007-01-03For float4/8, remove errno checks for pow() and exp() because only someBruce Momjian
platforms set errno, and we already have a check macro that detects under/overflow, so there is no reason for platform-specific code anymore.
2007-01-03Widen the money type to 64 bits.D'Arcy J.M. Cain
2007-01-02Adjust network errmsg("result is out of range") message to be consistentBruce Momjian
with other places.
2007-01-02Some platforms set errno on pow(), exp() overflow, some do not, so ifBruce Momjian
isinf(), fall through to our own infinity checks.
2007-01-02finite() no longer used; remove finite() platform-specificBruce Momjian
infrastructure.
2007-01-02Add n_live_tuples and n_dead_tuples to pg_stat_all_tables.Bruce Momjian
The purpose is to allow autovacuum-esq conditional vacuuming and clustering using SQL to discover the required stats. No documentation updates required. Catalog version updated. Glen Parker
2007-01-02Add #include <float.h> for platforms that still need it.Bruce Momjian
2007-01-02Fix float4/8 to handle Infinity and Nan consistently, e.g. Infinity is aBruce Momjian
valid result from a computation if one of the input values was infinity. The previous code assumed an operation that returned infinity was an overflow. Handle underflow/overflow consistently, and add checks for aggregate overflow. Consistently prevent Inf/Nan from being cast to integer data types. Fix INT_MIN % -1 to prevent overflow. Update regression results for new error text. Per report from Roman Kononov.
2006-12-30Support type modifiers for user-defined types, and pull most knowledgeTom Lane
about typmod representation for standard types out into type-specific typmod I/O functions. Teodor Sigaev, with some editorialization by Tom Lane.
2006-12-29Fix multiple breakages in last XML patch.Tom Lane
2006-12-29De-escape XML names when reverse-compiling XML expressions.Peter Eisentraut
2006-12-28Add send and recv functions for xml type.Peter Eisentraut
2006-12-28Handle content and document options in xmlparse() correctly.Peter Eisentraut
2006-12-24Bring some order and sanity to error handling in the xml patch.Tom Lane
Use a TRY block instead of (inadequate) ad-hoc coding to ensure that libxml is cleaned up after a failure. Report the intended SQLCODE instead of defaulting to XX000. Avoid risking use of a dangling pointer by keeping the persistent error buffer in TopMemoryContext. Be less trusting that error messages don't contain %. This patch doesn't do anything about changing the way the messages are put together --- this is just about mechanism.
2006-12-24Fix machine-dependent crash in sqlchar_to_unicode(). Get rid ofTom Lane
bletcherous and unsafe manipulation of global encoding setting. Clean up libxml reporting mechanism a bit (it still looks like a dangling-pointer crash waiting to happen, though, not to mention being far less than sane from a localization standpoint).
2006-12-24Code review for XML patch. Instill a bit of sanity in the location ofTom Lane
the XmlExpr code in various lists, use a representation that has some hope of reverse-listing correctly (though it's still a de-escaping function shy of correctness), generally try to make it look more like Postgres coding conventions.
2006-12-23Suppress various compiler warnings in new xml code.Tom Lane
2006-12-23Remove unnecessary parentheses in if() statements.Bruce Momjian
2006-12-23Restructure operator classes to allow improved handling of cross-data-typeTom Lane
cases. Operator classes now exist within "operator families". While most families are equivalent to a single class, related classes can be grouped into one family to represent the fact that they are semantically compatible. Cross-type operators are now naturally adjunct parts of a family, without having to wedge them into a particular opclass as we had done originally. This commit restructures the catalogs and cleans up enough of the fallout so that everything still works at least as well as before, but most of the work needed to actually improve the planner's behavior will come later. Also, there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way to create a new family right now is to allow CREATE OPERATOR CLASS to make one by default. I owe some more documentation work, too. But that can all be done in smaller pieces once this infrastructure is in place.