summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2009-04-09Remove SQL-compatibility function cardinality(). It is not exactly clearTom Lane
how this ought to behave for multi-dimensional arrays. Per discussion, not having it at all seems better than having it with what might prove to be the wrong behavior. We can always add it later when we have consensus on the correct behavior.
2009-04-09Treat EOF like \n for line-counting purposes in ParseConfigFile,Tom Lane
per bug #4752. Fujii Masao
2009-04-08Allow leading and trailing spaces around NaN in numeric_in.Tom Lane
Sam Mason, rewritten a bit by Tom.
2009-04-08XMLATTRIBUTES() should send the attribute values throughPeter Eisentraut
map_sql_value_to_xml_value() instead of directly through the data type output function. This is per SQL standard, and consistent with XMLELEMENT().
2009-04-08Oops, mustn't call textdomain() when compiling without --enable-nlsHeikki Linnakangas
2009-04-08Tell gettext which codeset to use by calling bind_textdomain_codeset(). WeHeikki Linnakangas
already did that on Windows, but it's needed on other platforms too when LC_CTYPE=C. With other locales, we enforce (or trust) that the codeset of the locale matches the server encoding so we don't need to bind it explicitly. It should do no harm in that case either, but I don't have full faith in the PG encoding -> OS codeset mapping table yet. Per recent discussion on pgsql-hackers.
2009-04-07Revert addition of units to GUC descriptions; doesn't affectBruce Momjian
postgresql.conf.
2009-04-07More GUC units doc updates.Bruce Momjian
Euler Taveira de Oliveira
2009-04-06Add unit documentation for various postgresql.conf settings.Bruce Momjian
2009-04-06Add entry in the encoding number to OS name table for KOI8-U.Peter Eisentraut
2009-04-06Properly align equals signs in new postgresql.conf units comments.Bruce Momjian
2009-04-06Document in postgresql.conf that the default units forBruce Momjian
log_min_duration_statement is milliseconds.
2009-04-06Display postgresql.conf unit options in an easier-to-understand,Bruce Momjian
2-column format.
2009-04-05Change cardinality() into a C-code function, instead of a SQL-languageTom Lane
alias for array_length(v,1). The efficiency gain here is doubtless negligible --- what I'm interested in is making sure that if we have second thoughts about the definition, we will not have to force a post-beta initdb to change the implementation.
2009-04-05Change EXPLAIN output so that subplans and initplans (particularly CTEs)Tom Lane
are individually labeled, rather than just grouped under an "InitPlan" or "SubPlan" heading. This in turn makes it possible for decompilation of a subplan reference to usefully identify which subplan it's referencing. I also made InitPlans identify which parameter symbol(s) they compute, so that references to those parameters elsewhere in the plan tree can be connected to the initplan that will be executed. Per a gripe from Robert Haas about EXPLAIN output of a WITH query being inadequate, plus some longstanding pet peeves of my own.
2009-04-04Rewrite interval_hash() so that the hashcodes are equal for values thatTom Lane
interval_eq() considers equal. I'm not sure how that fundamental requirement escaped us through multiple revisions of this hash function, but there it is; it's been wrong since interval_hash was first written for PG 7.1. Per bug #4748 from Roman Kononov. Backpatch to all supported releases. This patch changes the contents of hash indexes for interval columns. That's no particular problem for PG 8.4, since we've broken on-disk compatibility of hash indexes already; but it will require a migration warning note in the next minor releases of all existing branches: "if you have any hash indexes on columns of type interval, REINDEX them after updating".
2009-04-02Revert DTrace patch from Robert LorBruce Momjian
2009-04-02Give a better error message when trying to changeBruce Momjian
"effective_io_concurrency" on systems without posix_fadvise().
2009-04-02Add support for additional DTrace probes.Bruce Momjian
Robert Lor
2009-04-02Fix SetClientEncoding() to maintain a cache of previously selected encodingTom Lane
conversion functions. This allows transaction rollback to revert to a previous client_encoding setting without doing fresh catalog lookups. I believe that this explains and fixes the recent report of "failed to commit client_encoding" failures. This bug is present in 8.3.x, but it doesn't seem prudent to back-patch the fix, at least not till it's had some time for field testing in HEAD. In passing, remove SetDefaultClientEncoding(), which was used nowhere.
2009-04-02Fix GUC's reports of assign_hook failure to always include the parameter valueTom Lane
we failed to assign, even in "can't happen" cases. Motivated by wondering what's going on in a recent trouble report where "failed to commit" did happen.
2009-04-01Update comment to reflect that LC_COLLATE and LC_CTYPE are nowHeikki Linnakangas
per-database settings.
2009-03-31Modify the relcache to record the temp status of both local and nonlocalTom Lane
temp relations; this is no more expensive than before, now that we have pg_class.relistemp. Insert tests into bufmgr.c to prevent attempting to fetch pages from nonlocal temp relations. This provides a low-level defense against bugs-of-omission allowing temp pages to be loaded into shared buffers, as in the contrib/pgstattuple problem reported by Stuart Bishop. While at it, tweak a bunch of places to use new relcache tests (instead of expensive probes into pg_namespace) to detect local or nonlocal temp tables.
2009-03-31Add a "relistemp" boolean column to pg_class, which is true for temporaryTom Lane
relations (including a temp table's indexes and toast table/index), and false for normal relations. For ease of checking, this commit just adds the column and fills it correctly --- revising the relation access machinery to use it will come separately.
2009-03-27Add an errdetail explaining why we reject infinite dates and timestampsTom Lane
while converting to XML. Bernd Helmle
2009-03-27Fix possible failures when a tuplestore switches from in-memory to on-diskTom Lane
mode while callers hold pointers to in-memory tuples. I reported this for the case of nodeWindowAgg's primary scan tuple, but inspection of the code shows that all of the calls in nodeWindowAgg and nodeCtescan are at risk. For the moment, fix it with a rather brute-force approach of copying whenever one of the at-risk callers requests a tuple. Later we might think of some sort of reference-count approach to reduce tuple copying.
2009-03-25Adjust the APIs for GIN opclass support functions to allow the extractQuery()Tom Lane
method to pass extra data to the consistent() and comparePartial() methods. This is the core infrastructure needed to support the soon-to-appear contrib/btree_gin module. The APIs are still upward compatible with the definitions used in 8.3 and before, although *not* with the previous 8.4devel function definitions. catversion bump for changes in pg_proc entries (although these are just cosmetic, since GIN doesn't actually look at the function signature before calling it...) Teodor Sigaev and Oleg Bartunov
2009-03-23Remove munging of xml and xpath params to xpath(). The XML must now be a ↵Andrew Dunstan
well formed XML document.
2009-03-23More fixes for 8.4 DTrace probes. Remove useless BUFFER_HIT/BUFFER_MISSTom Lane
probes --- the BUFFER_READ_DONE probe provides the same information and more besides. Expand the LOCK_WAIT_START/DONE probe arguments so that there's actually some chance of telling what is being waited for. Update and clean up the documentation.
2009-03-22Add isExtend to the parameters of the buffer_read_start and buffer_read_doneTom Lane
DTrace probes, so that ordinary reads can be distinguished from relation extension operations. Move buffer_read_start probe to before the smgrnblocks() call that's needed in the isExtend case, since really that step should be charged as part of the time needed for the extension operation. (This makes it slightly harder to match the read_start with the associated read_done, since now you can't match them on blockNumber, but it should still be possible since isExtend operations on the same relation can never be interleaved.) Per recent discussion. In passing, add the page identity (forkNum/blockNum) to the parameters of the buffer_flush_start/buffer_flush_done probes, which were unaccountably lacking the info.
2009-03-22Remove the datetime keywords ABSTIME and RELTIME, which we'd been treating asTom Lane
noise words for the last twelve years, for compatibility with Berkeley-era output formatting of the special INVALID values for those datatypes. Considering that the datatypes themselves have been deprecated for awhile, this is taking backwards compatibility a little far. Per gripe from Josh Berkus.
2009-03-18Fix case of the just resurrected UCS_to_BIG5.pl script, and updateHeikki Linnakangas
Makefile to use it.
2009-03-18Add seven kanji characters defined in the Windows 950 codepage to ourHeikki Linnakangas
big5/win950 <-> UTF8 conversion tables. Per report by Roger Chang.
2009-03-17Improve zero-year comments.Bruce Momjian
2009-03-17Document that datetime year '0' is considered in a recent century, notBruce Momjian
just '00'.
2009-03-15Clean up the code for to_timestamp's conversion of year plus ISO day numberTom Lane
to date, as per bug #4702 and subsequent discussion. In particular, make it work for years specified using AD/BC or CC fields, and fix the test for "no year specified" so that it doesn't trigger inappropriately for 1 BC (which it was doing even in code paths that had nothing to do with to_timestamp). I also did some minor code beautification in the non-ISO-day-number code path. This area has been busted all along, but because the code has been rewritten repeatedly, it would be considerable trouble to back-patch. It's such a corner case that it doesn't seem worth the effort.
2009-03-12Fix core dump due to null-pointer dereference in to_char() when datetimeTom Lane
format codes are misapplied to a numeric argument. (The code still produces a pretty bogus error message in such cases, but I'll settle for stopping the crash for now.) Per bug #4700 from Sergey Burladyan. Problem exists in all supported branches, so patch all the way back. In HEAD, also clean up some ugly coding in the nearby cache management code.
2009-03-11Code review for dtrace probes added (so far) to 8.4. Adjust placement ofTom Lane
some bufmgr probes, take out redundant and memory-leak-inducing path arguments to smgr__md__read__done and smgr__md__write__done, fix bogus attempt to recalculate space used in sort__done, clean up formatting in places where I'm not sure pgindent will do a nice job by itself.
2009-03-09In parse_bool_with_len, avoid crash when no result pointer is passed. ProbablyPeter Eisentraut
an unlikely call mode, but better be safe.
2009-03-09Accept 'on' and 'off' as input for boolean data type, unifying the syntaxPeter Eisentraut
that the data type and GUC accepts. ITAGAKI Takahiro
2009-03-09Add summarization comment about visibility functions.Bruce Momjian
Add URL about the Halloween problem.
2009-03-09Revert pg_bind_textdomain_codeset to a existant-but-empty function whenAlvaro Herrera
ENABLE_NLS is not defined, for better compatibility of the backend with modules compiled the other way. Per note from Tom after my previous commit.
2009-03-08pg_bind_textdomain_codeset must exist only on ENABLE_NLS.Alvaro Herrera
2009-03-08On Windows, call bind_textdomain_codeset on domains other than the default one,Alvaro Herrera
too, so that the codeset is properly mapped on the newly added PL domains.
2009-03-04Put back our old workaround for machines that declare cbrt() in math.h butTom Lane
fail to provide the function itself. Not sure how we escaped testing anything later than 7.3 on such cases, but they still exist, as per André Volpato's report about AIX 5.3.
2009-03-02When we are in error recursion trouble, arrange to suppress translation andTom Lane
encoding conversion of any elog/ereport message being sent to the frontend. This generalizes a patch that I put in last October, which suppressed translation of only specific messages known to be associated with recursive can't-translate-the-message behavior. As shown in bug #4680, we need a more general answer in order to have some hope of coping with broken encoding conversion setups. This approach seems a good deal less klugy anyway. Patch in all supported branches.
2009-03-02Fix usage of char2wchar/wchar2char. Changes:Teodor Sigaev
- pg_wchar and wchar_t could have different size, so char2wchar doesn't call pg_mb2wchar_with_len to prevent out-of-bound memory bug - make char2wchar/wchar2char symmetric, now they should not be called with C-locale because mbstowcs/wcstombs oftenly doesn't work correct with C-locale. - Text parser uses pg_mb2wchar_with_len directly in case of C-locale and multibyte encoding Per bug report by Hiroshi Inoue <inoue@tpf.co.jp> and following discussion. Backpatch up to 8.2 when multybyte support was implemented in tsearch.
2009-02-28Fix buffer allocations in encoding conversion routines so that they won'tTom Lane
fail on zero-length inputs. This isn't an issue in normal use because the conversion infrastructure skips calling the converters for empty strings. However a problem was created by yesterday's patch to check whether the right conversion function is supplied in CREATE CONVERSION. The most future-proof fix seems to be to make the converters safe for this corner case.
2009-02-28Reduce the maximum value of vacuum_cost_delay and autovacuum_vacuum_cost_delayTom Lane
to 100ms (from 1000). This still seems to be comfortably larger than the useful range of the parameter, and it should help discourage people from picking uselessly large values. Tweak the documentation to recommend small values, too. Per discussion of a couple weeks ago.
2009-02-25Fix an old problem in decompilation of CASE constructs: the ruleutils.c codeTom Lane
looks for a CaseTestExpr to figure out what the parser did, but it failed to consider the possibility that an implicit coercion might be inserted above the CaseTestExpr. This could result in an Assert failure in some cases (but correct results if Asserts weren't enabled), or an "unexpected CASE WHEN clause" error in other cases. Per report from Alan Li. Back-patch to 8.1; problem doesn't exist before that because CASE was implemented differently.