aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
Commit message (Collapse)AuthorAge
* Provide a build-time option to store large relations as single files, ratherTom Lane2008-03-10
| | | | | | | | than dividing them into 1GB segments as has been our longtime practice. This requires working support for large files in the operating system; at least for the time being, it won't be the default. Zdenek Kotala
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Clarify log messagesPeter Eisentraut2007-12-13
|
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Remove FileUnlink(), which wasn't being used anywhere and interacted poorlyTom Lane2007-07-26
| | | | | | with the recent patch to log temp file sizes at removal time. Doesn't seem worth fixing since it's unused. In passing, make a few elog messages conform to the message style guide.
* Rework temp_tablespaces patch so that temp tablespaces are assigned separatelyTom Lane2007-06-07
| | | | | | | | | for each temp file, rather than once per sort or hashjoin; this allows spreading the data of a large sort or join across multiple tablespaces. (I remain dubious that this will make any difference in practice, but certain people insisted.) Arrange to cache the results of parsing the GUC variable instead of recomputing from scratch on every demand, and push usage of the cache down to the bottommost fd.c level.
* Create a GUC parameter temp_tablespaces that allows selection of theTom Lane2007-06-03
| | | | | | | | | | tablespace(s) in which to store temp tables and temporary files. This is a list to allow spreading the load across multiple tablespaces (a random list element is chosen each time a temp object is to be created). Temp files are not stored in per-database pgsql_tmp/ directories anymore, but per-tablespace directories. Jaime Casanova and Albert Cervera, with review by Bernd Helmle and Tom Lane.
* Revert temp_tablespaces because of coding problems, per Tom.Bruce Momjian2007-03-06
|
* Remove temporary Windows-specific debugging code.Magnus Hagander2007-02-28
|
* Add GUC temp_tablespaces to provide a default location for temporaryBruce Momjian2007-01-25
| | | | | | objects. Jaime Casanova
* Remove trace macro call from new log_temp_files, until it gets moreBruce Momjian2007-01-09
| | | | research.
* Add GUC log_temp_files to log the use of temporary files.Bruce Momjian2007-01-09
| | | | Bill Moran
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Remove temporary Windows-specific debugging code; it seems the problemTom Lane2006-11-06
| | | | | with fopen() not using FILE_SHARE_DELETE was indeed the bug we were after, given lack of recent reports.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Add some debug logging code to AllocateFile's failure path to log theTom Lane2006-08-24
| | | | | specific Windows error code (GetLastError). This is a hopefully temporary hack to try to diagnose rare failures. Magnus Hagander
* Fix printf mask for SizeVfdCacheBruce Momjian2006-05-30
| | | | Qingqing Zhou
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Declare the arguments of AllocateFile() as const char *, not char *.Tom Lane2006-03-04
| | | | This is consistent with the standard definition of fopen().
* Fix fsync code to test whether F_FULLFSYNC is available, instead ofTom Lane2006-01-17
| | | | assuming it always is on Darwin. Per report from Neil Brandt.
* Fix thinko in comment.Tom Lane2005-12-08
|
* Retry in FileRead and FileWrite if Windows returns ERROR_NO_SYSTEM_RESOURCES.Tom Lane2005-12-01
| | | | | | Also add a retry for Unixen returning EINTR, which hasn't been reported as an issue but at least theoretically could be. Patch by Qingqing Zhou, some minor adjustments by me.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-22
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Cause ShutdownPostgres to do a normal transaction abort during backendTom Lane2005-08-08
| | | | | | | | 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.
* Fix count_usable_fds() to stop trying to open files once it reachesTom Lane2005-08-07
| | | | | | max_files_per_process. Going further than that is just a waste of cycles, and it seems that current Cygwin does not cope gracefully with deliberately running the system out of FDs. Per Andrew Dunstan.
* Arrange for the postmaster (and standalone backends, initdb, etc) toTom Lane2005-07-04
| | | | | | | | chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
* Simplify uses of readdir() by creating a function ReadDir() thatTom Lane2005-06-19
| | | | | | | includes error checking and an appropriate ereport(ERROR) message. This gets rid of rather tedious and error-prone manipulation of errno, as well as a Windows-specific bug workaround, at more than a dozen call sites. After an idea in a recent patch by Heikki Linnakangas.
* Add support for wal_fsync_writethrough for Darwin, and restructure theBruce Momjian2005-05-20
| | | | | | code to better handle writethrough. Chris Campbell
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-31
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Refactor EXEC_BACKEND code so that postmaster child processes reattachTom Lane2004-12-29
| | | | | | | | | | to shared memory as soon as possible, ie, right after read_backend_variables. The effective difference from the original code is that this happens before instead of after read_nondefault_variables(), which loads GUC information and is apparently capable of expanding the backend's memory allocation more than you'd think it should. This should fix the failure-to-attach-to-shared-memory reports we've been seeing on Windows. Also clean up a few bits of unnecessarily grotty EXEC_BACKEND code.
* Restructure subtransaction handling to reduce resource consumption,Tom Lane2004-09-16
| | | | | | | | | | | | | | | | | as per recent discussions. Invent SubTransactionIds that are managed like CommandIds (ie, counter is reset at start of each top transaction), and use these instead of TransactionIds to keep track of subtransaction status in those modules that need it. This means that a subtransaction does not need an XID unless it actually inserts/modifies rows in the database. Accordingly, don't assign it an XID nor take a lock on the XID until it tries to do that. This saves a lot of overhead for subtransactions that are only used for error recovery (eg plpgsql exceptions). Also, arrange to release a subtransaction's XID lock as soon as the subtransaction exits, in both the commit and abort cases. This avoids holding many unique locks after a long series of subtransactions. The price is some additional overhead in XactLockTableWait, but that seems acceptable. Finally, restructure the state machine in xact.c to have a more orthogonal set of states for subtransactions.
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Fix subtransaction behavior for large objects, temp namespace, files,Tom Lane2004-07-28
| | | | | | | password/group files. Also allow read-only subtransactions of a read-write parent, but not vice versa. These are the reasonably noncontroversial parts of Alvaro's recent mop-up patch, plus further work on large objects to minimize use of the TopTransactionResourceOwner.
* Per previous discussions, get rid of use of sync(2) in favor ofTom Lane2004-05-31
| | | | | | | | | | | | | | | | | explicitly fsync'ing every (non-temp) file we have written since the last checkpoint. In the vast majority of cases, the burden of the fsyncs should fall on the bgwriter process not on backends. (To this end, we assume that an fsync issued by the bgwriter will force out blocks written to the same file by other processes using other file descriptors. Anyone have a problem with that?) This makes the world safe for WIN32, which ain't even got sync(2), and really makes the world safe for Unixen as well, because sync(2) never had the semantics we need: it offers no way to wait for the requested I/O to finish. Along the way, fix a bug I recently introduced in xlog recovery: file truncation replay failed to clear bufmgr buffers for the dropped blocks, which could result in 'PANIC: heap_delete_redo: no block' later on in xlog replay.
* Replace opendir/closedir calls throughout the backend with AllocateDirTom Lane2004-02-23
| | | | | | | | | | and FreeDir routines modeled on the existing AllocateFile/FreeFile. Like the latter, these routines will avoid failing on EMFILE/ENFILE conditions whenever possible, and will prevent leakage of directory descriptors if an elog() occurs while one is open. Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not critical code and there is no reason to force a DB restart on failure. All per recent trouble report from Olivier Hubaut.
* Do a direct probe during postmaster startup to determine the maximumTom Lane2004-02-23
| | | | | | number of openable files and the number already opened. This eliminates depending on sysconf(_SC_OPEN_MAX), and allows much saner behavior on platforms where open-file slots are used up by semaphores.
* 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.
* This patch is the next step towards (re)allowing fork/exec.Bruce Momjian2003-12-20
| | | | Claudio Natoli
* 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
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut2003-09-25
| | | | | terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
* Update copyrights to 2003.Bruce Momjian2003-08-04
|
* pgindent run.Bruce Momjian2003-08-04
|
* Error message editing in backend/storage.Tom Lane2003-07-24
|
* Code review for holdable-cursors patch. Fix error recovery, memoryTom Lane2003-04-29
| | | | | context sloppiness, some other things. Includes Neil's mopup patch of 22-Apr.
* Add Win32 path handling for / vs. \ and drive letters.Bruce Momjian2003-04-04
|
* This patch implements holdable cursors, following the proposalBruce Momjian2003-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (materialization into a tuple store) discussed on pgsql-hackers earlier. I've updated the documentation and the regression tests. Notes on the implementation: - I needed to change the tuple store API slightly -- it assumes that it won't be used to hold data across transaction boundaries, so the temp files that it uses for on-disk storage are automatically reclaimed at end-of-transaction. I added a flag to tuplestore_begin_heap() to control this behavior. Is changing the tuple store API in this fashion OK? - in order to store executor results in a tuple store, I added a new CommandDest. This works well for the most part, with one exception: the current DestFunction API doesn't provide enough information to allow the Executor to store results into an arbitrary tuple store (where the particular tuple store to use is chosen by the call site of ExecutorRun). To workaround this, I've temporarily hacked up a solution that works, but is not ideal: since the receiveTuple DestFunction is passed the portal name, we can use that to lookup the Portal data structure for the cursor and then use that to get at the tuple store the Portal is using. This unnecessarily ties the Portal code with the tupleReceiver code, but it works... The proper fix for this is probably to change the DestFunction API -- Tom suggested passing the full QueryDesc to the receiveTuple function. In that case, callers of ExecutorRun could "subclass" QueryDesc to add any additional fields that their particular CommandDest needed to get access to. This approach would work, but I'd like to think about it for a little bit longer before deciding which route to go. In the mean time, the code works fine, so I don't think a fix is urgent. - (semi-related) I added a NO SCROLL keyword to DECLARE CURSOR, and adjusted the behavior of SCROLL in accordance with the discussion on -hackers. - (unrelated) Cleaned up some SGML markup in sql.sgml, copy.sgml Neil Conway
* I checked all the previous string handling errors and most of them wereBruce Momjian2002-09-02
| | | | | | | | | | | | | | | already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa