summaryrefslogtreecommitdiff
path: root/src/backend/utils
AgeCommit message (Collapse)Author
2005-09-16Rename pg_complete_relation_size() to pg_total_relation_size(), for theNeil Conway
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.
2005-09-16Update two comments to refer to use the new list API names.Neil Conway
2005-09-12Tweak TCP-keepalive code so that an invalid setting doesn't cause usTom Lane
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.
2005-09-09timestamptz_izone should return the input, not NULL, when the inputTom Lane
is a non-finite timestamp, for consistency with related functions. In other words: +infinity rotated to a different timezone is still +infinity.
2005-09-09Fix the various forms of AT TIME ZONE to accept either timezones foundTom Lane
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.
2005-09-02Fix the spelling.Tom Lane
2005-09-02Update listen_addresses description.Bruce Momjian
Darcy Buskermolen
2005-09-01Short-circuit AllocSetReset if nothing has been palloc'd in the memoryTom Lane
context since the previous AllocSetReset. Original patch by Atsushi Ogawa, editorialized on a little bit by Tom Lane.
2005-08-30Update documentation about shared memory sizing to reflect currentTom Lane
reality.
2005-08-29Reduce default value of max_prepared_transactions from 50 to 5. ThisTom Lane
saves nearly 700kB in the default shared memory segment size, which seems worthwhile, and it is a feature that many users won't use anyway. Per Heikki's argument, there is no point in a compromise value --- those who are using 2PC at all will probably want it at least equal to max_connections. But we can't set it to zero by default without breaking the prepared_xacts regression test.
2005-08-29Fix platform-specific test for path prefix-ness: move it into path.c whereTom Lane
it can be done right. Allow explicit use of absolute DataDir path. Per Dave Page.
2005-08-26The idea of using _strncoll() on Windows doesn't work. Revert to sameTom Lane
code as we use on other platforms when encoding is not UTF8.
2005-08-26Arrange for indexes and toast tables to inherit their ownership fromTom Lane
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.
2005-08-25Factor out the common subexpression month_remainder * DAYS_PER_MONTHTom Lane
in interval_mul and interval_div. This avoids an optimization bug in A Certain Company's compiler (and given their explanation, I wouldn't be surprised if other compilers blow it too). Besides the code seems more clear this way --- in the original formulation, you had to mentally recognize the common subexpression in order to understand what was going on.
2005-08-25Back out pfrees for justify_hour function calls.Bruce Momjian
2005-08-25Fix memory leak when using justify_hours.Bruce Momjian
2005-08-24Add small hack to support use of Unicode-based locales on WIN32. ThisTom Lane
is not adequately tested yet, but let's get it into beta1 so it can be tested. Magnus Hagander and Tom Lane.
2005-08-22enable_constraint_exclusion => constraint_exclusionBruce Momjian
Also improve wording.
2005-08-21Minor GUC cleanups: document krb_server_hostname and custom_variable_classesTom Lane
in postgresql.conf.sample, mark custom_variable_classes as SIGHUP not POSTMASTER to agree with the documentation (I can't see a reason it has to be POSTMASTER so I think the docs are right).
2005-08-20Convert the arithmetic for shared memory size calculation from 'int'Tom Lane
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.
2005-08-20Repair problems with VACUUM destroying t_ctid chains too soon, and withTom Lane
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.
2005-08-19Fix LRU/ALL description mismatch for GUC parameter.Bruce Momjian
2005-08-19Consistently align comments in postgresql.conf, move some slightly toBruce Momjian
the right to stand out.
2005-08-18Add hint for to_char(interval) invalid format specifications.Bruce Momjian
2005-08-18Fix to_char(interval) to return proper year and century values.Bruce Momjian
Fix to_char(interval) to return large year/month/day/hour values that are larger than possible timestamp values. Prevent to_char(interval) format specifications that make no sense, like Month. Clean up formatting.c code to more logically handle return lengths.
2005-08-17Avoid an Assert failure if OuterUserId hasn't been set yet duringTom Lane
AbortTransaction. This can happen if a backend's InitPostgres transaction fails (eg, because the given username is invalid). Per Alvaro.
2005-08-17More formatting.c cleanups.Bruce Momjian
2005-08-17Small cleanup.Bruce Momjian
2005-08-17Adjust to_char/from_char code to use boolean "is_to_char" rather thanBruce Momjian
integer with flags.
2005-08-15Rename pg_stat_file columns to be more consistent. Split apart changeBruce Momjian
and creation columns to behave for Unix or Win32.
2005-08-15array_in() and array_recv() need to be more paranoid about validatingTom Lane
their OID parameter. It was possible to crash the backend with select array_in('{123}',0,0); because that would bypass the needed step of initializing the workspace. These seem to be the only two places with a problem, though (record_in and record_recv don't have the issue, and the other array functions aren't depending on user-supplied input). Back-patch as far as 7.4; 7.3 does not have the bug.
2005-08-15Clean up some stray remaining references to pg_shadow, pg_user, pg_group.Tom Lane
2005-08-14Change standard_compliant_strings to standard_conforming_strings.Peter Eisentraut
2005-08-13Tweak catalog cache management algorithms to reduce cost ofTom Lane
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.
2005-08-13Make pg_stat_file() use OUT parameters so that the user doesn't have toTom Lane
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.
2005-08-12Pass the type OID as the typioparam for all non-array types, rather thanTom Lane
only composite types as we did in 8.0. Per discussion with Martijn van Oosterhout.
2005-08-12This patch fixes the event type used to log output from theBruce Momjian
stderr-in-service or output-from-syslogger-in-service code. Previously everything was flagged as ERRORs there, which caused all instances to log "LOG: logger shutting down" as error... Please apply for 8.1. I'd also like it considered for 8.0 since logging non-errors as errors can be cause for alarm amongst people who actually look at their logs... Magnus Hagander
2005-08-12Fix up canonicalize_path to do the right thing in all cases (I think ...Tom Lane
this was harder than it seemed at first glance). Also push code for checking for ".." in file names into path.c where it belongs.
2005-08-12Code & docs review for server instrumentation patch. File timestampsTom Lane
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.
2005-08-12Add files to do read I/O on the cluster directory:Bruce Momjian
pg_stat_file() pg_read_file() pg_ls_dir() pg_reload_conf() pg_rotate_logfile() Dave Page Andreas Pflug
2005-08-12Solve the problem of OID collisions by probing for duplicate OIDsTom Lane
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.
2005-08-11Autovacuum loose end mop-up. Provide autovacuum-specific vacuum costTom Lane
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
2005-08-09Update postgresql.conf to show default ordering for wal_sync_method.Bruce Momjian
2005-08-08Modify AtEOXact_CatCache and AtEOXact_RelationCache to assume that theTom Lane
ResourceOwner mechanism already released all reference counts for the cache entries; therefore, we do not need to scan the catcache or relcache at transaction end, unless we want to do it as a debugging crosscheck. Do the crosscheck only in Assert mode. This is the same logic we had previously installed in AtEOXact_Buffers to avoid overhead with large numbers of shared buffers. I thought it'd be a good idea to do it here too, in view of Kari Lavikka's recent report showing a real-world case where AtEOXact_CatCache is taking a significant fraction of runtime.
2005-08-08Cause ShutdownPostgres to do a normal transaction abort during backendTom Lane
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.
2005-08-02Code and docs review for pg_column_size() patch.Tom Lane
2005-08-02Use ReadDir() not readdir() so as to have some modicum of error checking.Tom Lane
2005-08-02Un-Windows-ify newlines.Tom Lane
2005-08-01Add NOWAIT option to SELECT FOR UPDATE/SHARE.Tom Lane
Original patch by Hans-Juergen Schoenig, revisions by Karel Zak and Tom Lane.
2005-07-31Add per-user and per-database connection limit options.Tom Lane
This patch also includes preliminary update of pg_dumpall for roles. Petr Jelinek, with review by Bruce Momjian and Tom Lane.