aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAge
* Patches from Cyril Velter to make shared-memory-conflict-detection codeTom Lane2001-03-18
| | | | work in BeOS port.
* Support syncing WAL log to disk using either fsync(), fdatasync(),Tom Lane2001-03-16
| | | | | | | | O_SYNC, or O_DSYNC (as available on a given platform). Add GUC parameter to control sync method. Also, add defense to XLogWrite to prevent it from going nuts if passed a target write position that's past the end of the buffers so far filled by XLogInsert.
* Remove obsolete PowerPC-specific hack for comparisons to DBL_MINTom Lane2001-03-14
| | | | | (per recent discussion with Tatsuo). Hopefully the compilers with that old bug are all long gone.
* Fix numeric modulo operator for case of fractional right argument.Tom Lane2001-03-14
|
* XLOG (and related) changes:Tom Lane2001-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Store two past checkpoint locations, not just one, in pg_control. On startup, we fall back to the older checkpoint if the newer one is unreadable. Also, a physical copy of the newest checkpoint record is kept in pg_control for possible use in disaster recovery (ie, complete loss of pg_xlog). Also add a version number for pg_control itself. Remove archdir from pg_control; it ought to be a GUC parameter, not a special case (not that it's implemented yet anyway). * Suppress successive checkpoint records when nothing has been entered in the WAL log since the last one. This is not so much to avoid I/O as to make it actually useful to keep track of the last two checkpoints. If the things are right next to each other then there's not a lot of redundancy gained... * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs on alternate bytes. Polynomial borrowed from ECMA DLT1 standard. * Fix XLOG record length handling so that it will work at BLCKSZ = 32k. * Change XID allocation to work more like OID allocation. (This is of dubious necessity, but I think it's a good idea anyway.) * Fix a number of minor bugs, such as off-by-one logic for XLOG file wraparound at the 4 gig mark. * Add documentation and clean up some coding infelicities; move file format declarations out to include files where planned contrib utilities can get at them. * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or every CHECKPOINT_TIMEOUT seconds, whichever comes first. It is also possible to force a checkpoint by sending SIGUSR1 to the postmaster (undocumented feature...) * Defend against kill -9 postmaster by storing shmem block's key and ID in postmaster.pid lockfile, and checking at startup to ensure that no processes are still connected to old shmem block (if it still exists). * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency stop, for symmetry with postmaster and xlog utilities. Clean up signal handling in bootstrap.c so that xlog utilities launched by postmaster will react to signals better. * Standalone bootstrap now grabs lockfile in target directory, as added insurance against running it in parallel with live postmaster.
* FATAL errors should cause exit with nonzero status if we are not runningTom Lane2001-03-10
| | | | | under the postmaster --- specifically, if we are a standalone backend running under the initdb script, this is critical!
* Modify wchar conversion routines to not fetch the next byte past the endTom Lane2001-03-08
| | | | | | | | | | | | | of a counted input string. Marinos Yannikos' recent crash report turns out to be due to applying pg_ascii2wchar_with_len to a TEXT object that is smack up against the end of memory. This is the second just-barely- reproducible bug report I have seen that traces to some bit of code fetching one more byte than it is allowed to. Let's be more careful out there, boys and girls. While at it, I changed the code to not risk a similar crash when there is a truncated multibyte character at the end of an input string. The output in this case might not be the most reasonable output possible; if anyone wants to improve it further, step right up...
* Tweak portal (cursor) code so that it will not call the executor againTom Lane2001-02-27
| | | | | | | | | | | when user does another FETCH after reaching end of data, or another FETCH backwards after reaching start. This is needed because some plan nodes are not very robust about being called again after they've already returned NULL; for example, MergeJoin will crash in some states but not others. While the ideal approach would be for them all to handle this correctly, it seems foolish to assume that no such bugs would creep in again once cleaned up. Therefore, the most robust answer is to prevent the situation from arising at all.
* Massive commits for SunOS4 port.Tatsuo Ishii2001-02-27
|
* Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occurTom Lane2001-02-26
| | | | | | | | | | | only if at least N other backends currently have open transactions. This is not a great deal of intelligence about whether a delay might be profitable ... but it beats no intelligence at all. Note that the default COMMIT_DELAY is still zero --- this new code does nothing unless that setting is changed. Also, mark ENABLEFSYNC as a system-wide setting. It's no longer safe to allow that to be set per-backend, since we may be relying on some other backend's fsync to have synced the WAL log.
* Enhanced UTF-8/SJIS mapping generator, contributed byTatsuo Ishii2001-02-23
| | | | Eiji Tokuya" <e-tokuya@Mail.Sankyo-Unyu.co.jp>
* Change /*---- commants to /* where appropriate. pgindent will tightenBruce Momjian2001-02-22
| | | | up the comments later.
* Correct bogus output formatting of timeofday() function. A number ofTom Lane2001-02-21
| | | | microseconds < 100000 should be displayed as, eg, 13.000126, not 13.126.
* Change case-folding of keywords to conform to SQL99 and fix misbehaviorTom Lane2001-02-21
| | | | | | | in Turkish locale. Keywords are now checked under pure ASCII case-folding rules ('A'-'Z'->'a'-'z' and nothing else). However, once a word is determined not to be a keyword, it will be case-folded under the current locale, same as before. See pghackers discussion 20-Feb-01.
* Safe guard in case of imporper data is provided to elog()Tatsuo Ishii2001-02-21
| | | | in multi-byte build.
* Change default commit_delay to zero, update documentation.Tom Lane2001-02-18
|
* Defend against starting a non-MULTIBYTE-enabled backend in a databaseTom Lane2001-02-16
| | | | with encoding other than SQL_ASCII. Per recent discussion in pghackers.
* Add some notes about memory management of RI plans.Tom Lane2001-02-15
|
* Update notes about memory context scheme.Tom Lane2001-02-15
|
* Reduce default selectivity estimates for geometric operators; it seemsTom Lane2001-02-15
| | | | | | | the old ones were not small enough to ensure r-tree and gist indexes would get picked when available. These numbers are totally bogus anyway, but in the absence of any real estimation technique, we'd like to select indexes when available ...
* Unicode <-> SJIS new mapping tables (based on CP932.TXT) contributed byTatsuo Ishii2001-02-15
| | | | Eiji Tokuya" <e-tokuya@Mail.Sankyo-Unyu.co.jp>
* Change scoping of table and join refnames to conform to SQL92: a JOINTom Lane2001-02-14
| | | | | | | | | clause with an alias is a <subquery> and therefore hides table references appearing within it, according to the spec. This is the same as the preliminary patch I posted to pgsql-patches yesterday, plus some really grotty code in ruleutils.c to reverse-list a query tree with the correct alias name depending on context. I'd rather not have done that, but unless we want to force another initdb for 7.1, there's no other way for now.
* Please apply the following patch to fix AIX and IRIX timestamp behaviorBruce Momjian2001-02-13
| | | | | | | | | | | | | | | as previously discussed. It makes AIX and IRIX not use DST for dates before 1970. The following expected files need to be removed from the regression tests, they contain wrong results and are not needed any more. src/test/regress/expected/horology-1947-PDT.out src/test/regress/expected/tinterval-1947-PDT.out src/test/regress/expected/abstime-1947-PDT.out Zeugswetter Andreas
* poit -> point.Bruce Momjian2001-02-12
|
* Move pg_encoding_mblen() from common.c to wchar.c.Tatsuo Ishii2001-02-11
|
* conv.c did not compile anymore. Fix wrong header file inclusion.Tatsuo Ishii2001-02-11
|
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-10
| | | | | | | | | | | are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
* FixBTree flag still exists and may be used to turnVadim B. Mikheev2001-02-07
| | | | runtime recovery OFF.
* Out-of-bounds memory allocation request sizes should be treated as justTom Lane2001-02-06
| | | | | | | elog(ERROR) not an Assert trap, since we've downgraded out-of-memory to elog(ERROR) not a fatal error. Also, change the hard boundary from 256Mb to 1Gb, just so that anyone who's actually got that much memory to spare can play with TOAST objects approaching a gigabyte.
* Dump/display 'timestamp' as 'timestamp with time zone', to make room for aPeter Eisentraut2001-02-05
| | | | | future 'timestamp without time zone', which SQL claims is equivalent to plain 'timestamp'.
* Clean up handling of tuple descriptors so that result-tuple descriptorsTom Lane2001-01-29
| | | | | | | | allocated by plan nodes are not leaked at end of query. This doesn't really matter for normal queries, but it sure does for queries invoked repetitively inside SQL functions. Clean up some other grotty code associated with tupdescs, and fix a few other memory leaks exposed by tests with simple SQL functions.
* Re-read Unix-socket lock file every so often (every CheckPoint interval,Tom Lane2001-01-27
| | | | | | actually) to ensure that its file access time doesn't get old enough to tempt a /tmp directory cleaner to remove it. Still another reason we should never have put the sockets in /tmp in the first place ...
* Change float8-to-int8 conversion to round to nearest, rather thanTom Lane2001-01-26
| | | | | | | truncating to integer. Remove regress test that checks whether 4567890123456789 can be converted to float without loss; since that's 52 bits, it's on the hairy edge of failing with IEEE float8s, and indeed rint seems to give platform-dependent results for it.
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Fix bogus pattern for STRING.Peter Eisentraut2001-01-24
|
* Add all possible config file options.Bruce Momjian2001-01-24
|
* Put back old config contents until I am finished.Bruce Momjian2001-01-24
|
* Add "idle in transaction" status messageBruce Momjian2001-01-24
|
* Remove useless leftover global variable Ps_status_buffer.Peter Eisentraut2001-01-23
|
* Fix all the places that called heap_update() and heap_delete() withoutTom Lane2001-01-23
| | | | | | | | | | | bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
* Improve realloc() per idea from Karel Zak --- if chunk to be enlarged isTom Lane2001-01-23
| | | | at end of its block, maybe we can enlarge it in-place.
* Remove rangechecks on errno; just call strerror unconditionally. ThisTom Lane2001-01-22
| | | | | | | | | eliminates a raft of portability issues, including whether sys_nerr exists, whether the platform has any valid negative errnos, etc. The downside is minimal: errno shouldn't ever contain an invalid value anyway, and if it does, reasonably modern versions of strerror will not choke. This rangecheck idea seemed good at the time, but it's clearly a net loss, and I apologize to all concerned for having ever put it in.
* Deal with C++ incompatibility of sys_nerr declaration by taking it outTom Lane2001-01-21
| | | | | | | | of c.h altogether, and putting it into the only places that use it (elog.c and exc.c), instead. Modify these routines to check for a NULL or empty-string return from strerror, too, since some platforms define strerror to return empty string for unknown errors (what a useless definition that is ...). Clean up some cruft in ExcPrint while at it.
* Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane2001-01-19
| | | | into distinct concepts, per recent discussion on pghackers.
* Suppress compiler warning in MULTIBYTE code.Tom Lane2001-01-19
|
* Fix up "Postgres-style" time interval representation when fields haveThomas G. Lockhart2001-01-18
| | | | | | | | | | mixed-signs. Previous effort left way too many minus signs, and was at least as broken as the one before that :( Clean up "ISO-style" time interval representation to omit zero fields if there is at least one non-zero field. Supress some leading plus signs when not necessary for clarity. Replace every #ifdef __CYGWIN__ block with a cleaner TIMEZONE_GLOBAL macro defined in datetime.h.
* Change comparisons of tm->tm_isdst from "nonzero" to "greater than zero".Thomas G. Lockhart2001-01-17
| | | | | | | | | Not sure why some were this way, and others were already correct, but it seems to have been like this for several years. This caused problems on a few damaged platforms like AIX and IRIX which do not support DST calculations for years before 1970. Thanks to Andreas Zeugswetter <ZeugswetterA@wien.spardat.at> for finding the problem.
* Minor coding cleanups.Tom Lane2001-01-14
|
* Another go-round on making GetRawDatabaseInfo behave as well as it can,Tom Lane2001-01-14
| | | | | | | given the fundamental restriction of not looking at transaction commit data in pg_log. Use code that is actually based on tqual.c rather than ad-hoc tests. Also write the tuple fetch loop using standard access macros rather than ad-hoc code.
* Make aclcontains() do something that's at least vaguely reasonable:Tom Lane2001-01-14
| | | | | it now returns true if the aclitem argument exactly matches any one of the elements of the aclitem[] argument. Per complaint from Wolff 1/10/01.