aboutsummaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAge
* Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, toTom Lane2004-02-11
| | | | | | | | | | | wit: Add a header record to each WAL segment file so that it can be reliably identified. Avoid splitting WAL records across segment files (this is not strictly necessary, but makes it simpler to incorporate the header records). Make WAL entries for file creation, deletion, and truncation (as foreseen but never implemented by Vadim). Also, add support for making XLOG_SEG_SIZE configurable at compile time, similarly to BLCKSZ. Fix a couple bugs I introduced in WAL replay during recent smgr API changes. initdb is forced due to changes in pg_control contents.
* Check and set thread-safe functions separately, rather than as a singleBruce Momjian2004-02-11
| | | | | | | | | | variable. Remove thread locking for non-thread-safe functions, instead throw a compile error. Platforms will have to re-run tools/thread to record their thread safety.
* Properly set NEED_REENTRANT_FUNCS for threaded libpq/ecpg.Bruce Momjian2004-02-11
| | | | Without this patch, no thread locking or *_r functions were being used.
* Add configure support for determining UINT64_FORMAT, the appropriateTom Lane2004-02-10
| | | | snprintf format for uint64 items.
* 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
* 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.
* Win32 adjustments for dirmod and configure/configure.in.Bruce Momjian2004-02-02
|
* Fix a read of uninitialized memory in next_token() of hba.c, spotted viaNeil Conway2004-02-02
| | | | | | valgrind: a buffer passed to strncmp() had to be NUL-terminated. Original report and patch from Dennis Bjorkland, some cleanup by Andrew Dunstan, and finally some editorializing from Neil Conway.
* 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
* Remove sleep() and use single PG_SLEEP call for Win32 signal handlingBruce Momjian2004-01-30
| | | | | | and consistency. Change PG_USLEEP to use SleepEx() for signal interuptability.
* 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.
* Fix an obsolete file path mentioned in a comment.Neil Conway2004-01-25
|
* 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.
* Fix a minor bug introduced by the recent CREATE TABLE AS / WITH OIDSNeil Conway2004-01-23
| | | | | | patch: a 3-value enum was mistakenly assigned directly to a 'bool' in transformCreateStmt(). Along the way, change makeObjectName() to be static, as it isn't used outside analyze.c
* 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.
* Fix oversight in optimization that avoids an unnecessary projection stepTom Lane2004-01-22
| | | | | | when scanning a table that we need all the columns from. In case of SELECT INTO, we have to check that the hasoids flag matches the desired output type, too. Per report from Mike Mascari.
* 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.
* 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.
* When testing whether a sub-plan can do projection, use a general-purposeTom Lane2004-01-18
| | | | | | | | | | | | check instead of hardwiring assumptions that only certain plan node types can appear at the places where we are testing. This was always a pretty fragile assumption, and it turns out to be broken in 7.4 for certain cases involving IN-subselect tests that need type coercion. Also, modify code that builds finished Plan tree so that node types that don't do projection always copy their input node's targetlist, rather than having the tlist passed in from the caller. The old method makes it too easy to write broken code that thinks it can modify the tlist when it cannot.
* Tighten short-circuit tests for deciding whether we need to invokeTom Lane2004-01-16
| | | | | | | tuptoaster.c --- fields that are compressed in-line are not a reason to invoke the toaster. Along the way, add a couple more htup.h macros to eliminate confusing negated tests, and get rid of the already vestigial TUPLE_TOASTER_ACTIVE symbol.
* Adjusted calculation of shared memory requirements to newJan Wieck2004-01-15
| | | | | | ARC buffer replacement strategy. Jan
* Fix permission-checking bug reported by Tim Burgess 10-Feb-03 (this timeTom Lane2004-01-14
| | | | | | | | | for sure...). Rather than relying on the query context of a rangetable entry to identify what permissions it wants checked, store a full AclMode mask in each RTE, and check exactly those bits. This allows an RTE specifying, say, INSERT privilege on a view to be copied into a derived UPDATE query without changing meaning. Per recent discussion thread. initdb forced due to change of stored rule representation.
* Remove the following unused type definitions: bool8, bool16, bool32, word8,Neil Conway2004-01-10
| | | | word16, and word32.
* Implement "WITH / WITHOID OIDS" clause for CREATE TABLE AS. This isNeil Conway2004-01-10
| | | | | | | | | | intended to allow application authors to insulate themselves from changes to the default value of 'default_with_oids' in future releases of PostgreSQL. This patch also fixes a bug in the earlier implementation of the 'default_with_oids' GUC variable: code in gram.y should not examine the value of GUC variables directly due to synchronization issues.
* Oops, can't do cpp tests inside macros; make two macros instead.Bruce Momjian2004-01-09
|
* Change PG_DELAY from msec to usec and use it consistenly rather thanBruce Momjian2004-01-09
| | | | select(). Add Win32 Sleep() for delay.
* Cleanup: move the 'Value' node into a separate file, rather than puttingNeil Conway2004-01-07
| | | | it in the same file as the 'List' node.
* 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.
* Final rearrangement of main postgresql child process (ie.Bruce Momjian2004-01-06
| | | | | | | | BackendFork/SSDataBase/pgstat) startup, to allow fork/exec calls to closely mimic (the soon to be provided) Win32 CreateProcess equivalent calls. Claudio Natoli
* Code cleanup, mostly in the smgr:Neil Conway2004-01-06
| | | | | | | | | | | | | | | | | | - Update comment in IsReservedName() to the present day - Improve some variable & function names in commands/vacuum.c. I was planning to rewrite this to avoid lappend(), but since I still intend to do the list rewrite, there's no need for that. - Update some smgr comments which seemed to imply that we still forced all dirty pages to disk at commit-time. - Replace some #ifdef DIAGNOSTIC code with assertions. - Make the distinction between OS-level file descriptors and virtual file descriptors a little clearer in a few comments - Other minor comment improvements in the smgr code
* 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.
* Instead of rechecking lossy index operators by putting them into theTom Lane2004-01-06
| | | | | | | | | regular qpqual ('filter condition'), add special-purpose code to nodeIndexscan.c to recheck them. This ends being almost no net addition of code, because the removal of planner code balances out the extra executor code, but it is significantly more efficient when a lossy operator is involved in an OR indexscan. The old implementation had to recheck the entire indexqual in such cases.
* 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.
* Improve UniquePath logic to detect the case where the input is alreadyTom Lane2004-01-05
| | | | | known unique (eg, it is a SELECT DISTINCT ... subquery), and not do a redundant unique-ification step.
* Add the ability to extract OR indexscan conditions from OR-of-ANDTom Lane2004-01-05
| | | | | | | join conditions in which each OR subclause includes a constraint on the same relation. This implements the other useful side-effect of conversion to CNF format, without its unpleasant side-effects. As per pghackers discussion of a few weeks ago.
* 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.
* Merge restrictlist_selectivity into clauselist_selectivity byTom Lane2004-01-04
| | | | | | | | teaching the latter to accept either RestrictInfo nodes or bare clause expressions; and cache the selectivity result in the RestrictInfo node when possible. This extends the caching behavior of approx_selectivity to many more contexts, and should reduce duplicate selectivity calculations.