summaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* Add a trace_sort option to help with measuring resource usage of externalTom Lane2005-10-031-4/+8
| | | | sort operations. Per recent discussion. Simon Riggs and Tom Lane.
* Separate out the VacRUsage stuff as an independent module, in preparationTom Lane2005-10-032-18/+38
| | | | for using it for other things besides VACUUM.
* Expand pg_control information so that we can verify that the databaseTom Lane2005-10-031-2/+18
| | | | | | was created on a machine with alignment rules and floating-point format similar to the current machine. Per recent discussion, this seems like a good idea with the increasing prevalence of 32/64 bit environments.
* Change nextval and other sequence functions to specify their sequenceTom Lane2005-10-025-15/+22
| | | | | | | | | | | | | | | argument as a 'regclass' value instead of a text string. The frontend conversion of text string to pg_class OID is now encapsulated as an implicitly-invocable coercion from text to regclass. This provides backwards compatibility to the old behavior when the sequence argument is explicitly typed as 'text'. When the argument is just an unadorned literal string, it will be taken as 'regclass', which means that the stored representation will be an OID. This solves longstanding problems with renaming sequences that are referenced in default expressions, as well as new-in-8.1 problems with renaming such sequences' schemas or moving them to another schema. All per recent discussion. Along the way, fix some rather serious problems in dbmirror's support for mirroring sequence operations (int4 vs int8 confusion for instance).
* _SPI_execute_plan failed to return result tuple table to caller inTom Lane2005-10-011-1/+4
| | | | | | | | | the ProcessUtility case, resulting in an intratransaction memory leak if a utility command actually did return any tuples, as reported by Dmitry Karasik. Fix this and also make the behavior more consistent for cases involving nested SPI operations and multiple query trees, by ensuring that we store the state locally until it is ready to be returned to the caller.
* Repair planning bug introduced in 7.4: outer-join ON clauses that referencedTom Lane2005-09-281-2/+3
| | | | | | only the inner-side relation would be considered as potential equijoin clauses, which is wrong because the condition doesn't necessarily hold above the point of the outer join. Per test case from Kevin Grittner (bug#1916).
* Fix problems with PGXS builds against an installation tree that wasTom Lane2005-09-271-1/+3
| | | | | | | relocated after installation. We can't trust the installation paths inserted into Makefile.global by configure, so instead we must get the paths from pg_config. This requires extending pg_config to support all the separately-configurable path names, but that was on TODO anyway.
* The original patch to avoid building a hash join's hashtable when theTom Lane2005-09-251-2/+3
| | | | | | | | outer relation is empty did not work, per test case from Patrick Welche. It tried to use nodeHashjoin.c's high-level mechanisms for fetching an outer-relation tuple, but that code expected the hash table to be filled already. As patched, the code failed in corner cases such as having no outer-relation tuples for the first hash batch. Revert and rewrite.
* Suppress signed-vs-unsigned-char warnings.Tom Lane2005-09-241-14/+14
|
* This patch cleans up the access to members of ItemIdData.Bruce Momjian2005-09-222-5/+5
| | | | | | It uses existing macros instead of touching directly. ITAGAKI Takahiro
* Print proper cause of statement cancel, user interaction or timeout.Bruce Momjian2005-09-191-1/+3
|
* Rename pg_complete_relation_size() to pg_total_relation_size(), for theNeil Conway2005-09-163-11/+11
| | | | | | | | | | | | | | sake of brevity and clarity. Make pg_reload_conf(), pg_rotate_logfile(), and pg_cancel_backend() return a boolean rather than an integer to indicate success or failure. Along the way, make some minor cleanups to dbsize.c -- in particular, use elog() rather than ereport() for "shouldn't happen" error conditions, and remove some of the more flagrant violations of the Postgres indentation conventions. Catalog version bumped.
* Tweak TCP-keepalive code so that an invalid setting doesn't cause usTom Lane2005-09-121-19/+16
| | | | | | | to drop connections unceremoniously. Also some other marginal cleanups: don't query getsockopt() repeatedly if it fails, and avoid having the apparent definition of struct Port depend on which system headers you might have included or not. Oliver Jowett and Tom Lane.
* Given its current definition that depends on time(NULL), timetz_zoneTom Lane2005-09-091-2/+2
| | | | | | | | | is certainly no longer immutable, but must indeed be marked volatile. I wonder if it should use the value of now() (that is, transaction start time) so that it could be marked stable. But it's probably not important enough to be worth changing the code for ... indeed, I'm not even going to force an initdb for this catalog change, seeing that we just did one a few hours ago.
* Fix the various forms of AT TIME ZONE to accept either timezones foundTom Lane2005-09-091-2/+2
| | | | | | | | | in the zic database or zone names found in the date token table. This preserves the old ability to do AT TIME ZONE 'PST' along with the new ability to do AT TIME ZONE 'PST8PDT'. Per gripe from Bricklen Anderson. Also, fix some inconsistencies in usage of TZ_STRLEN_MAX --- the old code had the potential for one-byte buffer overruns, though given alignment considerations it's unlikely there was any real risk.
* Create the pg_pltemplate system catalog to hold template informationTom Lane2005-09-084-6/+88
| | | | | | for procedural languages. This replaces the hard-wired table I had originally proposed as a stopgap solution. For the moment, the initial contents only include languages shipped with the core distribution.
* Clean up a couple of ad-hoc computations of the maximum number of tuplesTom Lane2005-09-021-1/+11
| | | | | | | | | | | on a page, as suggested by ITAGAKI Takahiro. Also, change a few places that were using some other estimates of max-items-per-page to consistently use MaxOffsetNumber. This is conservatively large --- we could have used the new MaxHeapTuplesPerPage macro, or a similar one for index tuples --- but those places are simply declaring a fixed-size buffer and assuming it will work, rather than actively testing for overrun. It seems safer to size these buffers in a way that can't overflow even if the page is corrupt.
* Fix platform-specific test for path prefix-ness: move it into path.c whereTom Lane2005-08-291-1/+2
| | | | | it can be done right. Allow explicit use of absolute DataDir path. Per Dave Page.
* Sigh, looks like you need '.set mips2' before you can access MIPSTom Lane2005-08-291-3/+9
| | | | SYNC instruction.
* Tweak nodeBitmapAnd to stop evaluating sub-plan scans if it finds it'sTom Lane2005-08-281-1/+3
| | | | | got an empty bitmap after any step; the remaining subplans can no longer affect the result. Per a suggestion from Ilia Kantor.
* Add a SYNC instruction to the S_UNLOCK sequence for MIPS.Tom Lane2005-08-281-1/+9
|
* Change the division of labor between grouping_planner and query_plannerTom Lane2005-08-273-7/+8
| | | | | | | | | | | | | | so that the latter estimates the number of groups that grouping will produce. This is needed because it is primarily query_planner that makes the decision between fast-start and fast-finish plans, and in the original coding it was unable to make more than a crude rule-of-thumb choice when the query involved grouping. This revision helps us make saner choices for queries like SELECT ... GROUP BY ... LIMIT, as in a recent example from Mark Kirkwood. Also move the responsibility for canonicalizing sort_pathkeys and group_pathkeys into query_planner; this information has to be available anyway to support the first change, and doing it this way lets us get rid of compare_noncanonical_pathkeys entirely.
* Get the MIPS assembler syntax right. Also add a separate sync command;Tom Lane2005-08-271-4/+6
| | | | | the reference I consulted yesterday said SC does a SYNC, but apparently this is not true on newer MIPS processors, so be safe.
* Another try at the inlined MIPS spinlock code. Can't test this myself,Tom Lane2005-08-261-12/+12
| | | | but for sure it's not any more broken than the prior version.
* Adjust m68k spinlock code to avoid duplicate in-line and not-in-lineTom Lane2005-08-261-6/+6
| | | | definitions on recent Linux systems, per Martin Pitt.
* Some more mop-up for Windows IPv6 support. Andrew DunstanTom Lane2005-08-261-0/+8
|
* Arrange for indexes and toast tables to inherit their ownership fromTom Lane2005-08-261-1/+2
| | | | | | the parent table, even if the command that creates them is executed by someone else (such as a superuser or a member of the owning role). Per gripe from Michael Fuhr.
* Fix bogus freeaddrinfo() call in WIN32 code, extend gai_strerror toTom Lane2005-08-251-2/+14
| | | | cover more error codes. Per Petr Jelinek.
* Replace out-of-line tas() assembly code for MIPS with a properlyTom Lane2005-08-251-8/+36
| | | | constrained GCC inline version. Thiemo Seufer, by way of Martin Pitt.
* Add ALTER TABLE ENABLE/DISABLE TRIGGER commands. Change pg_dump toTom Lane2005-08-232-5/+14
| | | | | | use these instead of its previous hack of changing pg_class.reltriggers. Documentation is lacking, will add that later. Patch by Satoshi Nagayasu, review and some extra work by Tom Lane.
* enable_constraint_exclusion => constraint_exclusionBruce Momjian2005-08-221-2/+2
| | | | Also improve wording.
* Convert the arithmetic for shared memory size calculation from 'int'Tom Lane2005-08-2021-45/+49
| | | | | | | | | | | to 'Size' (that is, size_t), and install overflow detection checks in it. This allows us to remove the former arbitrary restrictions on NBuffers etc. It won't make any difference in a 32-bit machine, but in a 64-bit machine you could theoretically have terabytes of shared buffers. (How efficiently we could manage 'em remains to be seen.) Similarly, num_temp_buffers, work_mem, and maintenance_work_mem can be set above 2Gb on a 64-bit machine. Original patch from Koichi Suzuki, additional work by moi.
* Make GetMultiXactIdMembers() a public function.Tatsuo Ishii2005-08-201-1/+2
|
* Add BackendXidGetPid().Tatsuo Ishii2005-08-201-1/+2
|
* Repair problems with VACUUM destroying t_ctid chains too soon, and withTom Lane2005-08-204-24/+53
| | | | | | | | | | | | insufficient paranoia in code that follows t_ctid links. (We must do both because even with VACUUM doing it properly, the intermediate state with a dangling t_ctid link is visible concurrently during lazy VACUUM, and could be seen afterwards if either type of VACUUM crashes partway through.) Also try to improve documentation about what's going on. Patch is a bit bulky because passing the XMAX information around required changing the APIs of some low-level heapam.c routines, but it's not conceptually very complicated. Per trouble report from Teodor and subsequent analysis. This needs to be back-patched, but I'll do that after 8.1 beta is out.
* Fix up LIMIT/OFFSET planning so that we cope with non-constant LIMITTom Lane2005-08-181-2/+3
| | | | | | | | | | or OFFSET clauses by using estimate_expression_value(). The main advantage of this is that if the expression is a Param and we have a value for the Param, we'll use that value rather than defaulting. Also, fix some thinkos in the logic for combining LIMIT/OFFSET with an externally supplied tuple fraction (this covers cases like EXISTS(...LIMIT...)). And make sure the results of all this are shown by EXPLAIN. Per a gripe from Merlin Moncure.
* Avoid an Assert failure if OuterUserId hasn't been set yet duringTom Lane2005-08-171-1/+2
| | | | | AbortTransaction. This can happen if a backend's InitPostgres transaction fails (eg, because the given username is invalid). Per Alvaro.
* Rename pg_stat_file columns to be more consistent. Split apart changeBruce Momjian2005-08-151-2/+2
| | | | and creation columns to behave for Unix or Win32.
* Allow the pgstat views to show toast tables as well as regular tablesTom Lane2005-08-152-4/+4
| | | | | | | | (the stats system has always collected this info, but the views were filtering it out). Modify autovacuum so that over-threshold activity in a toast table can trigger a VACUUM of the parent table, even if the parent didn't appear to need vacuuming itself. Per discussion a month or so back about "short, wide tables".
* Tweak catalog cache management algorithms to reduce cost ofTom Lane2005-08-131-11/+15
| | | | | | | | | | | | | | | | | SearchCatCacheList and ReleaseCatCacheList. Previously, we incremented and decremented the refcounts of list member tuples along with the list itself, but that's unnecessary, and very expensive when the list is big. It's cheaper to change only the list refcount. When we are considering deleting a cache entry, we have to check not only its own refcount but its parent list's ... but it's easy to arrange the code so that this check is not made in any commonly-used paths, so the cost is really nil. The bigger gain though is to refrain from DLMoveToFront'ing each individual member tuple each time the list is referenced. To keep some semblance of fair space management, lists are just marked as used or not since the last cache cleanout search, and we do a MoveToFront pass only when about to run a cleanout. In combination, these changes reduce the costs of SearchCatCacheList and ReleaseCatCacheList from about 4.5% of pgbench runtime to under 1%, according to my gprof results.
* Make pg_stat_file() use OUT parameters so that the user doesn't have toTom Lane2005-08-132-9/+5
| | | | | | | remember the output parameter set for himself. It's a bit of a kluge but fixing array_in to work in bootstrap mode looks worse. I removed the separate pg_file_length() function, as it no longer has any real notational advantage --- you can write (pg_stat_file(...)).length.
* Fix up canonicalize_path to do the right thing in all cases (I think ...Tom Lane2005-08-121-1/+2
| | | | | this was harder than it seemed at first glance). Also push code for checking for ".." in file names into path.c where it belongs.
* Code & docs review for server instrumentation patch. File timestampsTom Lane2005-08-123-6/+8
| | | | | | should surely be timestamptz not timestamp; fix some but not all of the holes in check_and_make_absolute(); other minor cleanup. Also put in the missed catversion bump.
* Remove BufferBlockPointers array in favor of a base + (bufnum) * BLCKSZTom Lane2005-08-121-3/+3
| | | | | | | | computation. On modern machines this is as fast if not faster, and we don't have to clog the CPU's L2 cache with a tens-of-KB pointer array. If we ever decide to adopt a more dynamic allocation method for shared buffers, we'll probably have to revert this patch, but in the meantime we might as well save a few bytes and nanoseconds. Per Qingqing Zhou.
* Add files to do read I/O on the cluster directory:Bruce Momjian2005-08-123-3/+28
| | | | | | | | | | | pg_stat_file() pg_read_file() pg_ls_dir() pg_reload_conf() pg_rotate_logfile() Dave Page Andreas Pflug
* Solve the problem of OID collisions by probing for duplicate OIDsTom Lane2005-08-125-11/+15
| | | | | | | whenever we generate a new OID. This prevents occasional duplicate-OID errors that can otherwise occur once the OID counter has wrapped around. Duplicate relfilenode values are also checked for when creating new physical files. Per my recent proposal.
* Autovacuum loose end mop-up. Provide autovacuum-specific vacuum costTom Lane2005-08-116-9/+18
| | | | | | | delay and limit, both as global GUCs and as table-specific entries in pg_autovacuum. stats_reset_on_server_start is now OFF by default, but a reset is forced if we did WAL replay. XID-wrap vacuums do not ANALYZE, but do FREEZE if it's a template database. Alvaro Herrera
* Cause ShutdownPostgres to do a normal transaction abort during backendTom Lane2005-08-082-3/+4
| | | | | | | | exit, instead of trying to take shortcuts. Introduce some additional shutdown callback routines to eliminate kluges like having ProcKill be responsible for shutting down the buffer manager. Ensure that the order of operations during shutdown is predictable and what you would expect given the module layering.
* Actually, this macro had worse problems than a bogus name ...Tom Lane2005-08-051-3/+2
|
* Fix misspelled macro name. Doesn't appear to be used anywhere yet,Tom Lane2005-08-051-2/+2
| | | | so no one noticed.