aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAge
* Added hints about the reason, why the command string inJan Wieck2004-02-12
| | | | | | the view pg_stat_activity is missing, as per Bruces suggestion. Jan
* Centralize implementation of delay code by creating a pg_usleep()Tom Lane2004-02-10
| | | | | | | | | subroutine in src/port/pgsleep.c. Remove platform dependencies from miscadmin.h and put them in port.h where they belong. Extend recent vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and non-btree index vacuuming. By the way, where is the documentation for the cost-based-delay patch?
* Restructure smgr API as per recent proposal. smgr no longer depends onTom Lane2004-02-10
| | | | | | | | | the relcache, and so the notion of 'blind write' is gone. This should improve efficiency in bgwriter and background checkpoint processes. Internal restructuring in md.c to remove the not-very-useful array of MdfdVec objects --- might as well just use pointers. Also remove the long-dead 'persistent main memory' storage manager (mm.c), since it seems quite unlikely to ever get resurrected.
* Win32 signals cleanup. Patch by Magnus Hagander, with input from ClaudioNeil Conway2004-02-08
| | | | | | | | | | | | | | | | | | | | | | Natoli and Bruce Momjian (and some cosmetic fixes from Neil Conway). Changes: - remove duplicate signal definitions from pqsignal.h - replace pqkill() with kill() and redefine kill() in Win32 - use ereport() in place of fprintf() in some error handling in pqsignal.c - export pg_queue_signal() and make use of it where necessary - add a console control handler for Ctrl-C and similar handling on Win32 - do WaitForSingleObjectEx() in CHECK_FOR_INTERRUPTS() on Win32; query cancelling should now work on Win32 - various other fixes and cleanups
* Cost based vacuum delay feature.Jan Wieck2004-02-06
| | | | Jan
* Backing out the background writer sync() option.Jan Wieck2004-02-04
| | | | Jan
* Use memmove() rather than memcpy() in set_var_from_var(). If this functionNeil Conway2004-02-04
| | | | | | | is asked to assign a variable to itself, it will result in doing a memcpy() on an entirely-overlapping memory range, which results in undefined behavior according to ANSI C. That said, it is unlikely to actually do anything bad on any sane libc, but this keeps valgrind quiet.
* pwdTom Lane2004-02-03
|
* Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.Tom Lane2004-02-03
| | | | | | | Make btree index creation and initial validation of foreign-key constraints use maintenance_work_mem rather than work_mem as their memory limit. Add some code to guc.c to allow these variables to be referenced by their old names in SHOW and SET commands, for backwards compatibility.
* Add function (actually an int4 and an int8 version) that generatesJoe Conway2004-02-03
| | | | | | | | a series of numbers, optionally using an explicit step size other than the default value (one). Use function in the information_schema to replace hard-wired knowledge of INDEX_MAX_KEYS. initdb forced due to pg_proc change. Documentation update still needed -- will be committed separately.
* Avoid generating invalid character encoding sequences in make_greater_string.Tom Lane2004-02-02
| | | | Not sure how this mistake evaded detection for so long.
* Adjust rename on Win32 to only link to temp name while holding lock,Bruce Momjian2004-02-02
| | | | then release locks and loop over renaming to active file name.
* Briefly,Bruce Momjian2004-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure + Makefile changes * shared memory attaching in EXEC_BACKEND case (+ minor fix for apparent cygwin bug under cygwin/EXEC_BACKEND case only) * PATH env var separator differences * missing win32 rand functions added * placeholder replacements for sync etc under port.h To those who are really interested, and there are a few of you: the attached patch + file will allow the source base to be compiled (and, for some definition, "run") under MingW, with the following caveats (I wanted to first properly fix all but the last of these, but y'all won't quit asking for a patch :-): * child death: SIGCHLD not yet sent, so as a minimum, you'll need to put in some sort of delay after StartupDatabase, and handle setting StartupPID to 0 etc (ie. the stuff the reaper() signal function is supposed to do) * dirmod.c: comment out the elog calls * dfmgr.c: some hackage required to substitute_libpath_macro * slru/xact.c: comment out the errno checking after the readdir (fixed by next version of MingW) Again, this is only if you *really* want to see postgres compile and start, and is a nice leg-up for working on the other Win32 TODO list items. Just don't expect too much else from it at this point... Claudio Natoli
* Make length() disregard trailing spaces in char(n) values, per discussionTom Lane2004-02-01
| | | | | some time ago and recent patch from Gavin Sherry. Update documentation to point out that trailing spaces are insignificant in char(n).
* Micro-opt: replace calls likeNeil Conway2004-01-31
| | | | | | | appendStringInfo(buf, "%s", str); with appendStringInfoString(buf, str); as the latter form is slightly faster.
* Fix text_position to not scan past end of source string in multibyteTom Lane2004-01-31
| | | | | case, per report from Korea PostgreSQL Users' Group. Also do some cosmetic cleanup in nearby code.
* Review uses of IsUnderPostmaster, change some tests to look atTom Lane2004-01-28
| | | | | | | whereToSendOutput instead because they are really inquiring about the correct client communication protocol. Update some comments. This is pointing towards supporting regular FE/BE client protocol in a standalone backend, per discussion a month or so back.
* Here's the latest win32 signals code, this time in the form of a patchBruce Momjian2004-01-27
| | | | | | | | | | | | | | | | | against the latest shapshot. It also includes the replacement of kill() with pqkill() and sigsetmask() with pqsigsetmask(). Passes all tests fine on my linux machine once applied. Still doesn't link completely on Win32 - there are a few things still required. But much closer than before. At Bruce's request, I'm goint to write up a README file about the method of signals delivery chosen and why the others were rejected (basically a summary of the mailinglist discussions). I'll finish that up once/if the patch is accepted. Magnus Hagander
* [all] Removed call to getppid in SendPostmasterSignal, replacing with aBruce Momjian2004-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostmasterPid variable, which gets set (early) in PostmasterMain getppid would not be the postmaster? [fork/exec] Implements processCancelRequest by keeping an array of pid/cancel_key structs in shared mem [fork/exec] Moves AttachSharedMemoryAndSemaphores call for backends into SubPostmasterMain [win32] Implements reaper/waitpid by keeping an arrays of children pids,handles in postmaster local mem - this item is largely untested, for reasons which should be obvious, but appears sound [win32/all] Added extern for pgpipe in Win32 case, and changed the second pipe call (which seems to have been missed earlier) to pgpipe [win32] #define'd ftruncate to chsize in the Win32 case [win32] PG_USLEEP for Win32 has a misplaced paren. Fixed. [win32] DLLIMPORT handling for MingW case Claudio Natoli
* Back out win32 patch so we can apply it separately.Bruce Momjian2004-01-26
|
* Attached is a patch that fixes some trivial typos and alignment. PleaseBruce Momjian2004-01-26
| | | | | | apply. Alvaro Herrera
* Ensure that close() and fclose() are checked for errors, at least inTom Lane2004-01-26
| | | | | | cases involving writes. Per recent discussion about the possibility of close-time failures on some filesystems. There is a TODO item for this, too.
* Added GUC variable bgwriter_flush_method controlling the actionJan Wieck2004-01-24
| | | | | | | | | | | | | done by the background writer between writing dirty blocks and napping. none (default) no action sync bgwriter calls smgrsync() causing a sync(2) A global sync() is only good on dedicated database servers, so more flush methods should be added in the future. Jan
* Revise GEQO planner to make use of some heuristic knowledge about SQL, namelyTom Lane2004-01-23
| | | | | | | | | | | | | | that it's good to join where there are join clauses rather than where there are not. Also enable it to generate bushy plans at need, so that it doesn't fail in the presence of multiple IN clauses containing sub-joins. These changes appear to improve the behavior enough that we can substantially reduce the default pool size and generations count, thereby decreasing the runtime, and yet get as good or better plans as we were getting in 7.4. Consequently, adjust the default GEQO parameters. I also modified the way geqo_effort is used so that it affects both population size and number of generations; it's now useful as a single control to adjust the GEQO runtime-vs-plan-quality tradeoff. Bump geqo_threshold to 12, since even with these changes GEQO seems to be slower than the regular planner at 11 relations.
* Remove ExpandDatabasePath(), which is unused and must have been so sinceTom Lane2004-01-22
| | | | 7.1, because the path interpretation it embodies has been wrong since 7.1.
* Repair error apparently introduced in the initial coding of GUC: theTom Lane2004-01-21
| | | | | | default value for geqo_effort is supposed to be 40, not 1. The actual 'genetic' component of the GEQO algorithm has been practically disabled since 7.1 because of this mistake. Improve documentation while at it.
* If we don't have shared libraries, we don't have conversions. MakeTom Lane2004-01-21
| | | | | conversion_create.sql be empty (except for a helpful comment) in this case. Allows initdb to succeed with --disable-shared.
* Fix bit-rot in support for building with --disable-shared. This patchTom Lane2004-01-21
| | | | | gets us past 'make install', but initdb still fails for lack of conversion libraries ...
* Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_pathTom Lane2004-01-19
| | | | | | | | | | | should not be too eager to reject paths involving unknown schemas, since it can't really tell whether the schemas exist in the target database. (Also, when reading pg_dumpall output, it could be that the schemas don't exist yet, but eventually will.) ALTER USER SET has a similar issue. So, reduce the normal ERROR to a NOTICE when checking search_path values for these commands. Supporting this requires changing the API for GUC assign_hook functions, which causes the patch to touch a lot of places, but the changes are conceptually trivial.
* Add a hash table to cache lookups of 'C'-language functions (that is,Tom Lane2004-01-19
| | | | | | dynamically loaded C functions). Some limited testing suggests that this puts the lookup speed for external functions just about on par with built-in functions. Per discussion with Eric Ridge.
* Repair misestimation of indexscan CPU costs. When an indexqual containsTom Lane2004-01-17
| | | | | | a run-time key (that is, a nonconstant expression compared to the index variable), the key is evaluated just once per scan, but we were charging costs as though it were evaluated once per visited index entry.
* [Forced commit to add log message that I fat-fingered last time]Tom Lane2004-01-08
| | | | | Give a more reasonable error message when lock file exists but has zero length; prior code confused this with could-not-read-file case.
* makeTom Lane2004-01-07
|
* More janitorial work: remove the explicit casting of NULL literals to aNeil Conway2004-01-07
| | | | | | | | pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
* Apply the core parts of Dennis Bjorklund's patch to allow functionTom Lane2004-01-06
| | | | | | | | | parameters to be declared with names. pg_proc has a column to store names, and CREATE FUNCTION can insert data into it, but that's all as yet. I need to do more work on the pg_dump and plpgsql portions of the patch before committing those, but I thought I'd get the bulky changes in before the tree drifts under me. initdb forced due to pg_proc change.
* Remove unused 'noversion' command-line option processing from theNeil Conway2004-01-06
| | | | backend.
* Make the 'wal_debug' GUC variable a boolean (rather than an integer), andNeil Conway2004-01-06
| | | | hide it behind #ifdef WAL_DEBUG blocks.
* Adjust indexscan planning logic to keep RestrictInfo nodes associatedTom Lane2004-01-05
| | | | | | | | | | | with index qual clauses in the Path representation. This saves a little work during createplan and (probably more importantly) allows reuse of cached selectivity estimates during indexscan planning. Also fix latent bug: wrong plan would have been generated for a 'special operator' used in a nestloop-inner-indexscan join qual, because the special operator would not have gotten into the list of quals to recheck. This bug is only latent because at present the special-operator code could never trigger on a join qual, but sooner or later someone will want to do it.
* There's no longer any good reason for genbki.sh and Gen_fmgrtab.sh toTom Lane2004-01-04
| | | | | | run the data through cpp, and we know of at least one platform where unusual cpp behavior breaks the process. So remove the cpp step, and make consequent simplifications.
* Use hash table name, not one-size-fits-all 'DynaHashTable', to identifyTom Lane2003-12-29
| | | | | memory contexts belonging to hash tables. Makes the memory stats printout a little more useful.
* Using canonicalize_qual() to get rid of duplicate index predicateTom Lane2003-12-29
| | | | | | | conditions is overkill; set_union() does the job about as well, and much more efficiently. Furthermore this avoids assuming that canonicalize_qual() will check for duplicate clauses at all, which it may not always do.
* Clean up the usage of canonicalize_qual(): in particular, be consistentTom Lane2003-12-28
| | | | | | | | | about whether it is applied before or after eval_const_expressions(). I believe there were some corner cases where the system would fail to recognize that a partial index is applicable because of the previous inconsistency. Store normal rather than 'implicit AND' representations of constraints and index predicates in the catalogs. initdb forced due to representation change of constraints/predicates.
* > > I have no idea if this in Oracle or not. But it's something IBruce Momjian2003-12-25
| | | | | | | | | | | | | | | > > needed, and other people in the past asked about it too. > > It is in Oracle, but you aren't exactly on the spot. It should be > > IYYY - 4 digits ('2003') > IYY - 3 digits ('003') > IY - 2 digits ('03') > I - 1 digit ('3') Here is an updated patch that does that. Kurt Roeckx
* Fix a number of places where reconfiguring with a different installationTom Lane2003-12-23
| | | | | prefix would fail, because the new path did not get propagated to where it needed to be. Note this would fail even with --enable-depend.
* Back out:Bruce Momjian2003-12-21
| | | | | | | > Attached is a patch that addressed all the discussed issues > that did not break backward compatability, including the > ability to output ISO-8601 compliant intervals by setting > datestyle to iso8601basic.
* In my mind there were two categories of open issuesBruce Momjian2003-12-20
| | | | | | | | | | | | | | | | | | | | | | | | a) ones that are 100% backward (such as the comment about outputting this format) and b) ones that aren't (such as deprecating the current postgresql shorthand of '1Y1M'::interval = 1 year 1 minute in favor of the ISO-8601 'P1Y1M'::interval = 1 year 1 month. Attached is a patch that addressed all the discussed issues that did not break backward compatability, including the ability to output ISO-8601 compliant intervals by setting datestyle to iso8601basic. Interval values can now be written as ISO 8601 time intervals, using the "Format with time-unit designators". This format always starts with the character 'P', followed by a string of values followed by single character time-unit designators. A 'T' separates the date and time parts of the interval. Ron Mayer
* Make to_hex() behave portably on negative input values (treat them asTom Lane2003-12-19
| | | | unsigned integers). Per report from Jim Crate.
* Use a shutdown callback to ensure proper clean up when rescanningJoe Conway2003-12-19
| | | | | partially-evaluated SRFs. Per report found here: http://archives.postgresql.org/pgsql-general/2003-12/msg00851.php
* Fix DecodeInterval to handle '-0.1' sanely, per gripe from Tilo Schwarz.Tom Lane2003-12-17
|
* This patch properly sets the prototype for the on_shmem_exit andPeter Eisentraut2003-12-12
| | | | | | | on_proc_exit functions, and adjust all other related code to use the proper types too. by Kurt Roeckx