summaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the index AM API slightly: move currentItemData andNeil Conway2007-01-204-10/+10
| | | | | | | currentMarkData from IndexScanDesc to the opaque structs for the AMs that need this information (currently gist and hash). Patch from Heikki Linnakangas, fixes by Neil Conway.
* Fix xmlconcat by properly merging the XML declarations. Add aggregatePeter Eisentraut2007-01-204-5/+14
| | | | function xmlagg.
* Add support for converting binary values (i.e. bytea) into xml values,Peter Eisentraut2007-01-191-1/+9
| | | | | with new GUC parameter "xmlbinary" that controls the output encoding, as per SQL/XML standard.
* Change the sed rules in the regression test for pg_regress hackery to createAlvaro Herrera2007-01-191-1/+5
| | | | | | | the generated files, to help Visual C++ to run these tests. The tests still pass in VPATH and normal builds. Patch from Magnus Hagander, editorialized by me.
* Extend yesterday's patch so that the bgwriter is also told to forgetTom Lane2007-01-171-1/+3
| | | | pending fsyncs during DROP DATABASE. Obviously necessary in hindsight :-(
* Implement width_bucket() for the float8 data type.Neil Conway2007-01-163-4/+7
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Arrange for autovacuum to be killed when another operation wants to be aloneAlvaro Herrera2007-01-163-4/+6
| | | | | | accessing it, like DROP DATABASE. This allows the regression tests to pass with autovacuum enabled, which open the gates for finally enabling autovacuum by default.
* Add support for xmlval IS DOCUMENT expression.Peter Eisentraut2007-01-142-3/+5
|
* Use XML output escaping also in XMLFOREST.Peter Eisentraut2007-01-121-1/+2
|
* Allow Borland CC to compile libpq and psql.Bruce Momjian2007-01-111-1/+9
| | | | | | Backpatch to 8.2.X. L Bayuk
* Allow Borland CC to compile libpq and psql.Bruce Momjian2007-01-112-4/+4
| | | | L Bayuk
* Use libxml's xmlwriter API for producing XML elements, instead of doingPeter Eisentraut2007-01-101-1/+3
| | | | | our own printing dance. This does a better job of quoting and escaping the values.
* Make sure BYTE_ORDER gets defined in 64-bit builds on Solaris,Tom Lane2007-01-101-1/+12
| | | | per Stefan Kaltenbrunner.
* Change the planner-to-executor API so that the planner tells the executorTom Lane2007-01-106-34/+54
| | | | | | | | | | | | | | | | which comparison operators to use for plan nodes involving tuple comparison (Agg, Group, Unique, SetOp). Formerly the executor looked up the default equality operator for the datatype, which was really pretty shaky, since it's possible that the data being fed to the node is sorted according to some nondefault operator class that could have an incompatible idea of equality. The planner knows what it has sorted by and therefore can provide the right equality operator to use. Also, this change moves a couple of catalog lookups out of the executor and into the planner, which should help startup time for pre-planned queries by some small amount. Modify the planner to remove some other cavalier assumptions about always being able to use the default operators. Also add "nulls first/last" info to the Plan node for a mergejoin --- neither the executor nor the planner can cope yet, but at least the API is in place.
* Enable another five tuple status bits by using the high bits of theBruce Momjian2007-01-092-10/+19
| | | | | | nattr field, and rename the field. Heikki Linnakangas
* Add GUC log_temp_files to log the use of temporary files.Bruce Momjian2007-01-091-1/+2
| | | | Bill Moran
* Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LASTTom Lane2007-01-0913-89/+133
| | | | | | | | | | | | 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.
* Some fine-tuning of xmlpi in corner cases:Peter Eisentraut2007-01-071-2/+2
| | | | | | - correct error codes - do syntax checks in correct order - strip leading spaces of argument
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05307-613/+613
| | | | back-stamped for this.
* Stamp major release 8.3.0, and increment library version numbers.Bruce Momjian2007-01-051-4/+4
|
* Fix some small typos in comments. Greg StarkTom Lane2007-01-041-2/+2
|
* Fix regex_fixed_prefix() to cope reasonably well with regex patterns of theTom Lane2007-01-031-1/+2
| | | | | | | | | | 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.
* Clean up smgr.c/md.c APIs as per discussion a couple months ago. Instead ofTom Lane2007-01-031-13/+12
| | | | | | | | | | | | | | | | | | having md.c return a success/failure boolean to smgr.c, which was just going to elog anyway, let md.c issue the elog messages itself. This allows better error reporting, particularly in cases such as "short read" or "short write" which Peter was complaining of. Also, remove the kluge of allowing mdread() to return zeroes from a read-beyond-EOF: this is now an error condition except when InRecovery or zero_damaged_pages = true. (Hash indexes used to require that behavior, but no more.) Also, enforce that mdwrite() is to be used for rewriting existing blocks while mdextend() is to be used for extending the relation EOF. This restriction lets us get rid of the old ad-hoc defense against creating huge files by an accidental reference to a bogus block number: we'll only create new segments in mdextend() not mdwrite() or mdread(). (Again, when InRecovery we allow it anyway, since we need to allow updates of blocks that were later truncated away.) Also, clean up the original makeshift patch for bug #2737: move the responsibility for padding relation segments to full length into md.c.
* Widen the money type to 64 bits.D'Arcy J.M. Cain2007-01-032-9/+12
|
* finite() no longer used; remove finite() platform-specificBruce Momjian2007-01-022-5/+1
| | | | infrastructure.
* Add n_live_tuples and n_dead_tuples to pg_stat_all_tables.Bruce Momjian2007-01-022-3/+7
| | | | | | | | | 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
* Support type modifiers for user-defined types, and pull most knowledgeTom Lane2006-12-3013-161/+244
| | | | | | about typmod representation for standard types out into type-specific typmod I/O functions. Teodor Sigaev, with some editorialization by Tom Lane.
* De-escape XML names when reverse-compiling XML expressions.Peter Eisentraut2006-12-291-1/+2
|
* Add send and recv functions for xml type.Peter Eisentraut2006-12-284-6/+13
|
* Add a defense to prevent core dumps if 8.2 version of rank_cd() is used withTom Lane2006-12-281-1/+2
| | | | | | | | the 8.1 SQL function definition for it. Per report from Rajesh Kumar Mallah, such a DBA error doesn't seem at all improbable, and the cost of checking for it is not very high compared to the cost of running this function. (It would have been better to change the C name of the function so it wouldn't be called by the old SQL definition, but it's too late for that now in the 8.2 branch.)
* Fix failure due to accessing an already-freed tuple descriptor in a planTom Lane2006-12-262-2/+5
| | | | | | | | | | | | involving HashAggregate over SubqueryScan (this is the known case, there may well be more). The bug is only latent in releases before 8.2 since they didn't try to access tupletable slots' descriptors during ExecDropTupleTable. The least bogus fix seems to be to make subqueries share the parent query's memory context, so that tupdescs they create will have the same lifespan as those of the parent query. There are comments in the code envisioning going even further by not having a separate child EState at all, but that will require rethinking executor access to range tables, which I don't want to tackle right now. Per bug report from Jean-Pierre Pelletier.
* Fix machine-dependent crash in sqlchar_to_unicode(). Get rid ofTom Lane2006-12-241-1/+3
| | | | | | | 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).
* Code review for XML patch. Instill a bit of sanity in the location ofTom Lane2006-12-247-65/+59
| | | | | | | 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.
* Suppress various compiler warnings in new xml code.Tom Lane2006-12-231-2/+2
|
* Restructure operator classes to allow improved handling of cross-data-typeTom Lane2006-12-2320-1827/+1697
| | | | | | | | | | | | | | | | 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.
* Catalog version bump for SQL/XML changes.Peter Eisentraut2006-12-211-2/+2
|
* Initial SQL/XML support: xml data type and initial set of functions.Peter Eisentraut2006-12-2110-8/+124
|
* Set pg_am.amstrategies to zero for index AMs that don't have fixedTom Lane2006-12-182-6/+8
| | | | | | | operator strategy numbers, ie, GiST and GIN. This is almost cosmetic enough to not need a catversion bump, but since the opr_sanity regression test has to change in sync with the catalog entry, I figured I'd better do one.
* Fix planner to do the right thing when a degenerate outer join (one whoseTom Lane2006-12-121-2/+3
| | | | | | | joinclause doesn't use any outer-side vars) requires a "bushy" plan to be created. The normal heuristic to avoid joins with no joinclause has to be overridden in that case. Problem is new in 8.2; before that we forced the outer join order anyway. Per example from Teodor.
* Add a paramtypmod field to Param nodes. This is dead weight for ParamsTom Lane2006-12-102-5/+11
| | | | | | | | | | representing externally-supplied values, since the APIs that carry such values only specify type not typmod. However, for PARAM_SUBLINK Params it is handy to carry the typmod of the sublink's output column. This is a much cleaner solution for the recently reported 'could not find pathkey item to sort' and 'failed to find unique expression in subplan tlist' bugs than my original 8.2-compatible patch. Besides, someday we might want to support typmods for external parameters ...
* Remove the logId/logSeg fields from pg_control, because they are not neededTom Lane2006-12-081-4/+2
| | | | | | | | | | | | | | | | | | | in normal operation, and we can avoid rewriting pg_control at every log segment switch if we don't insist that these values be valid. Reducing the number of pg_control updates is a good idea for both performance and reliability. It does make pg_resetxlog's life a bit harder, but that seems a good tradeoff; and anyway the change to pg_resetxlog amounts to automating something people formerly needed to do by hand, namely look at the existing pg_xlog files to make sure the new WAL start point was past them. In passing, change the wording of xlog.c's "database system was interrupted" messages: describe the pg_control timestamp as "last known up at" rather than implying it is the exact time of service interruption. With this change the timestamp will generally be the time of the last checkpoint, which could be many minutes before the failure; and we've already seen indications that people tend to misinterpret the old wording. initdb forced due to change in pg_control layout. Simon Riggs and Tom Lane
* Add a txn_start column to pg_stat_activity. This makes it easier toNeil Conway2006-12-063-5/+9
| | | | | | | | identify long-running transactions. Since we already need to record the transaction-start time (e.g. for now()), we don't need any additional system calls to report this information. Catversion bumped, initdb required.
* Refactor ExecGetJunkAttribute to avoid searching for junk attributesTom Lane2006-12-042-6/+13
| | | | | | by name on each and every row processed. Profiling suggests this may buy a percent or two for simple UPDATE scenarios, which isn't huge, but when it's so easy to get ...
* Stamp 8.2, except configure.in.Bruce Momjian2006-12-021-3/+3
|
* Mark to_char(timestamp without timezone) as stable, not immutable, since itsTom Lane2006-11-281-10/+10
| | | | | | | | | | | | result now depends on the lc_messages setting, as noted by Bruce. Also, mark to_number() and the numeric-type variants of to_char() as stable, because their results depend on lc_numeric; this is a longstanding oversight. Also, mark to_date() and to_char(interval) as stable; although these appear not to depend on any GUC variables as of CVS HEAD, that seems a property unlikely to survive future improvements. It seems best to mark all the formatting functions stable and be done with it. catversion not bumped, because this does not seem critical enough to force a post-RC1 initdb, and anyway we cannot do so in the back branches.
* protect vfprintf from hijacking by Windows gettext just like other members ↵Andrew Dunstan2006-11-281-1/+7
| | | | of the *printf family.
* update for rc1REL8_2_RC1PostgreSQL Daemon2006-11-251-3/+3
|
* Change pg_stat_all_tables and sister views to put the recently-addedTom Lane2006-11-242-4/+4
| | | | | | | | | vacuum/analyze timestamp columns at the end, rather than at a random spot in the middle as in the original patch. This was deemed more usable as well as less likely to break existing application code. initdb forced accordingly. In passing, remove former kluge for initializing pg_stat_file()'s pg_proc entry --- bootstrap mode was fixed recently so that this can be done without any hacks, but I overlooked this usage.
* Update lock comments for concurrent index creation, analyze.Bruce Momjian2006-11-231-3/+4
| | | | Walter Cruz
* Get rid of retail definitions of HAVE_STRDUP and HAVE_VSNPRINTF inTom Lane2006-11-211-1/+1
| | | | | some of the Windows-only makefiles; the correct place to assert these things is pg_config.h.win32. Per bug #2677.