aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAge
...
* Add seven kanji characters defined in the Windows 950 codepage to ourHeikki Linnakangas2009-03-18
| | | | | | big5/win950 <-> UTF8 conversion tables. Per report by Roger Chang.
* Improve zero-year comments.Bruce Momjian2009-03-17
|
* Document that datetime year '0' is considered in a recent century, notBruce Momjian2009-03-17
| | | | just '00'.
* Clean up the code for to_timestamp's conversion of year plus ISO day numberTom Lane2009-03-15
| | | | | | | | | | | | 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.
* Fix core dump due to null-pointer dereference in to_char() when datetimeTom Lane2009-03-12
| | | | | | | | | | 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.
* Code review for dtrace probes added (so far) to 8.4. Adjust placement ofTom Lane2009-03-11
| | | | | | | 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.
* In parse_bool_with_len, avoid crash when no result pointer is passed. ProbablyPeter Eisentraut2009-03-09
| | | | an unlikely call mode, but better be safe.
* Accept 'on' and 'off' as input for boolean data type, unifying the syntaxPeter Eisentraut2009-03-09
| | | | | | that the data type and GUC accepts. ITAGAKI Takahiro
* Add summarization comment about visibility functions.Bruce Momjian2009-03-09
| | | | Add URL about the Halloween problem.
* Revert pg_bind_textdomain_codeset to a existant-but-empty function whenAlvaro Herrera2009-03-09
| | | | | | | 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.
* pg_bind_textdomain_codeset must exist only on ENABLE_NLS.Alvaro Herrera2009-03-08
|
* On Windows, call bind_textdomain_codeset on domains other than the default one,Alvaro Herrera2009-03-08
| | | | too, so that the codeset is properly mapped on the newly added PL domains.
* Put back our old workaround for machines that declare cbrt() in math.h butTom Lane2009-03-04
| | | | | | 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.
* When we are in error recursion trouble, arrange to suppress translation andTom Lane2009-03-02
| | | | | | | | | | | 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.
* Fix usage of char2wchar/wchar2char. Changes:Teodor Sigaev2009-03-02
| | | | | | | | | | | | | | | | - 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.
* Fix buffer allocations in encoding conversion routines so that they won'tTom Lane2009-02-28
| | | | | | | | 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.
* Reduce the maximum value of vacuum_cost_delay and autovacuum_vacuum_cost_delayTom Lane2009-02-28
| | | | | | | 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.
* Fix an old problem in decompilation of CASE constructs: the ruleutils.c codeTom Lane2009-02-25
| | | | | | | | | | | 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.
* Remove the special cases to prevent minus-zero results in float4 and float8Tom Lane2009-02-18
| | | | | | | | | | | | | | unary minus operators. We weren't attempting to prevent minus zero anywhere else; in view of our gradual trend to make the float datatypes more IEEE standard compliant, we should allow minus zero here rather than disallow it elsewhere. We don't, however, expect that all platforms will produce minus zero, so we need to adjust the one affected regression test to allow both results. Per discussion of bug #4660. (In passing, clean up a couple other minor infelicities in float.c.)
* Start background writer during archive recovery. Background writer now performsHeikki Linnakangas2009-02-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | its usual buffer cleaning duties during archive recovery, and it's responsible for performing restartpoints. This requires some changes in postmaster. When the startup process has done all the initialization and is ready to start WAL redo, it signals the postmaster to launch the background writer. The postmaster is signaled again when the point in recovery is reached where we know that the database is in consistent state. Postmaster isn't interested in that at the moment, but that's the point where we could let other backends in to perform read-only queries. The postmaster is signaled third time when the recovery has ended, so that postmaster knows that it's safe to start accepting connections. The startup process now traps SIGTERM, and performs a "clean" shutdown. If you do a fast shutdown during recovery, a shutdown restartpoint is performed, like a shutdown checkpoint, and postmaster kills the processes cleanly. You still have to continue the recovery at next startup, though. Currently, the background writer is only launched during archive recovery. We could launch it during crash recovery as well, but it seems better to keep that codepath as simple as possible, for the sake of robustness. And it couldn't do any restartpoints during crash recovery anyway, so it wouldn't be that useful. log_restartpoints is gone. Use log_checkpoints instead. This is yet to be documented. This whole operation is a pre-requisite for Hot Standby, but has some value of its own whether the hot standby patch makes 8.4 or not. Simon Riggs, with lots of modifications by me.
* Teach the planner to treat a partial unique index as proving a variable isTom Lane2009-02-15
| | | | | | | unique for a particular query, if the index predicate is satisfied. This requires a bit of reordering of operations so that we check the predicates before doing any selectivity estimates, but shouldn't really cause any noticeable slowdown. Per a comment from Michal Politowski.
* Support for KOI8U encodingPeter Eisentraut2009-02-10
|
* Remove the encoding *numbers* from the comments. They are useless, andPeter Eisentraut2009-02-10
| | | | make maintenance harder.
* Add possibility to generate only some files, by passing command-linePeter Eisentraut2009-02-10
| | | | arguments.
* Fix to_timestamp() to not require upper/lower case matching for meridianBruce Momjian2009-02-07
| | | | | | | | | designations (AM/PM). Also separate out matching of a meridian with periods (e.g. A.M.) and with those without. Do the same for AD/BC. Brendan Jurd
* Clean up some loose ends from the column privileges patch: addTom Lane2009-02-06
| | | | | | | | | | | | | | | | | | | | | | has_column_privilege and has_any_column_privilege SQL functions; fix the information_schema views that are supposed to pay attention to column privileges; adjust pg_stats to show stats for any column you have select privilege on; and fix COPY to allow copying a subset of columns if the user has suitable per-column privileges for all the columns. To improve efficiency of some of the information_schema views, extend the has_xxx_privilege functions to allow inquiring about the OR of a set of privileges in just one call. This is just exposing capability that already existed in the underlying aclcheck routines. In passing, make the information_schema views report the owner's own privileges as being grantable, since Postgres assumes this even when the grant option bit is not set in the ACL. This is a longstanding oversight. Also, make the new has_xxx_privilege functions for foreign data objects follow the same coding conventions used by the older ones. Stephen Frost and Tom Lane
* Fix unnest() to handle a toasted input array safely. Per report fromTom Lane2009-01-30
| | | | Alvaro.
* Replace argument-checking Asserts with regular test-and-elog checks in allTom Lane2009-01-29
| | | | | | | | | | | | encoding conversion functions. These are not can't-happen cases because it's possible to create a conversion with the wrong conversion function for the specified encoding pair. That would lead to an Assert crash in an Assert-enabled build, or incorrect conversion otherwise, neither of which is desirable. This would be a DOS issue if production databases were customarily built with asserts enabled, but fortunately that's not so. Per an observation by Heikki. Back-patch to all supported branches.
* Silence compiler warnings in new win32 locale codeMagnus Hagander2009-01-27
| | | | | | when building on mingw. ITAGAKI Takahiro
* Revert updatable viewsPeter Eisentraut2009-01-27
|
* Allow extracting and parsing of reloptions from a bare pg_class tuple, andAlvaro Herrera2009-01-26
| | | | | | refactor the relcache code that used to do that. This allows other callers (particularly autovacuum) to do the same without necessarily having to open and lock a table.
* Support column-level privileges, as required by SQL standard.Tom Lane2009-01-22
| | | | Stephen Frost, with help from KaiGai Kohei and others
* Automatic view update rulesPeter Eisentraut2009-01-22
| | | | Bernd Helmle
* Explicitly bind gettext to the correct encoding on Windows.Magnus Hagander2009-01-22
| | | | Original patch from Hiroshi Inoue.
* Remove stray ' character at end of line.Magnus Hagander2009-01-21
| | | | | For some reason it broke OpenBSD compile even when it's inside a #ifdef WIN32 block.....
* Make win32 builds always do SetEnvironmentVariable() when doing putenv().Magnus Hagander2009-01-21
| | | | | | | | | | | Also, if linked against other versions than the default MSVCRT library (for example the MSVC build which links against MSVCRT80), also update the cache in the default MSVCRT at the same time. This should fix the issues with setting LC_MESSAGES on the MSVC build. Original patch from Hiroshi Inoue and Hiroshi Saito, much rewritten by me.
* Make some strings translatable again that were accidentally removed inMagnus Hagander2009-01-21
| | | | earlier patch to fix "printf-arguments".
* Use the new text domain names ("postgres-8.4" instead of "postgres")Magnus Hagander2009-01-19
| | | | Hiroshi Inoue
* Add vacuum_freeze_table_age GUC option, to control when VACUUM shouldHeikki Linnakangas2009-01-16
| | | | | ignore the visibility map and scan the whole table, to advance relfrozenxid.
* Implement prefetching via posix_fadvise() for bitmap index scans. A newTom Lane2009-01-12
| | | | | | | | | | GUC variable effective_io_concurrency controls how many concurrent block prefetch requests will be issued. (The best way to handle this for plain index scans is still under debate, so that part is not applied yet --- tgl) Greg Stark
* Code review of strftime patch, per comments from Tom:Magnus Hagander2009-01-09
| | | | | * Use correct buffer size MAX_L10N_DATA * Use strlcpy instead of StrNCpy
* Fix strftime usage on Win32 when trying to fetch the locale-awareMagnus Hagander2009-01-09
| | | | | | | parts of a time string so it properly handles different encodings. Original patch by Hiroshi Saito, heavily reworked by me and ITAGAKI Takahiro.
* Make krb_realm and krb_server_hostname be pg_hba options only, and removeMagnus Hagander2009-01-09
| | | | | | | their GUCs. In passing, noted that the pg_hba options for krb5 authentication weren't listed at all - so add this.
* Revert current_query() change to use debug_query_string again; add comment.Bruce Momjian2009-01-08
|
* Create a third option named "partition" for constraint_exclusion, and make itTom Lane2009-01-07
| | | | | | | | | the default. This setting enables constraint exclusion checks only for appendrel members (ie, inheritance children and UNION ALL arms), which are the cases in which constraint exclusion is most likely to be useful. Avoiding the overhead for simple queries that are unlikely to benefit should bring the cost down to the point where this is a reasonable default setting. Per today's discussion.
* Have current_query() use ActivePortal->sourceText rather thanBruce Momjian2009-01-07
| | | | | debug_query_string; this allows current_query() to be more accurate; docs updated; per idea from Tom
* Insert conditional SPI_push/SPI_pop calls into InputFunctionCall,Tom Lane2009-01-07
| | | | | | | | | | | | | | | | | | | | OutputFunctionCall, and friends. This allows SPI-using functions to invoke datatype I/O without concern for the possibility that a SPI-using function will be called (which could be either the I/O function itself, or a function used in a domain check constraint). It's a tad ugly, but not nearly as ugly as what'd be needed to make this work via retail insertion of push/pop operations in all the PLs. This reverts my patch of 2007-01-30 that inserted some retail SPI_push/pop calls into plpgsql; that approach only fixed plpgsql, and not any other PLs. But the other PLs have the issue too, as illustrated by a recent gripe from Christian Schröder. Back-patch to 8.2, which is as far back as this solution will work. It's also as far back as we need to worry about the domain-constraint case, since earlier versions did not attempt to check domain constraints within datatype input. I'm not aware of any old I/O functions that use SPI themselves, so this should be sufficient for a back-patch.
* Add comment that it is difficult to access the more accurateBruce Momjian2009-01-07
| | | | 'query_string' from current_query().
* Fix executor/spi.h to follow our usual conventions for include files, ie,Tom Lane2009-01-07
| | | | | | | | | not include postgres.h nor anything else it doesn't directly need. Add #includes to calling files as needed to compensate. Per my proposal of yesterday. This should be noted as a source code change in the 8.4 release notes, since it's likely to require changes in add-on modules.
* Make the log output of 'vxid' between csvlog and stderr/syslogBruce Momjian2009-01-07
| | | | | | | | consistent. Currently, in csvlog, vxid of an auxiliary process isn't displayed. On the other hand, in stderr/syslog, invalid vxid (-1/0) of that is displayed. Fujii Masao