summaryrefslogtreecommitdiff
path: root/src/backend/access/transam
AgeCommit message (Collapse)Author
2004-02-11Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, toTom Lane
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.
2004-02-10Centralize implementation of delay code by creating a pg_usleep()Tom Lane
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?
2004-02-10Restructure smgr API as per recent proposal. smgr no longer depends onTom Lane
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.
2004-01-28Review uses of IsUnderPostmaster, change some tests to look atTom Lane
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.
2004-01-26Attached is a patch that fixes some trivial typos and alignment. PleaseBruce Momjian
apply. Alvaro Herrera
2004-01-26Ensure that close() and fclose() are checked for errors, at least inTom Lane
cases involving writes. Per recent discussion about the possibility of close-time failures on some filesystems. There is a TODO item for this, too.
2004-01-26Repair incorrect order of operations in GetNewTransactionId(). We mustTom Lane
complete ExtendCLOG() before advancing nextXid, so that if that routine fails, the next incoming transaction will try it again. Per trouble report from Christopher Kings-Lynne.
2004-01-19Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_pathTom Lane
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.
2004-01-09Change PG_DELAY from msec to usec and use it consistenly rather thanBruce Momjian
select(). Add Win32 Sleep() for delay.
2004-01-07More janitorial work: remove the explicit casting of NULL literals to aNeil Conway
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.
2004-01-06Suppress compiler warning (xlog_outrec is unused if not WAL_DEBUG).Tom Lane
2004-01-06Make the 'wal_debug' GUC variable a boolean (rather than an integer), andNeil Conway
hide it behind #ifdef WAL_DEBUG blocks.
2003-12-20This patch is the next step towards (re)allowing fork/exec.Bruce Momjian
Claudio Natoli
2003-12-14I posted some bufmgr cleanup a few weeks ago, but it conflicted withNeil Conway
some concurrent changes Jan was making to the bufmgr. Here's an updated version of the patch -- it should apply cleanly to CVS HEAD and passes the regression tests. This patch makes the following changes: - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer() macros, and replace uses of them with calls to the appropriate functions. - remove a bunch of #ifdef BMTRACE code: it is ugly & broken (i.e. it doesn't compile) - make BufferReplace() return a bool, not an int - cleanup some logic in bufmgr.c; should be functionality equivalent to the previous code, just cleaner now - remove the BM_PRIVATE flag as it is unused - improve a few comments, etc.
2003-12-12This patch properly sets the prototype for the on_shmem_exit andPeter Eisentraut
on_proc_exit functions, and adjust all other related code to use the proper types too. by Kurt Roeckx
2003-12-02Add a warning to AtEOXact_SPI() to catch cases where the currentJoe Conway
transaction has been committed without SPI_finish() being called first. Per recent discussion here: http://archives.postgresql.org/pgsql-patches/2003-11/msg00286.php
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-10-16Fix bad interaction between NOTIFY processing and V3 extended queryTom Lane
protocol, per report from Igor Shevchenko. NOTIFY thought it could do its thing if transaction blockState is TBLOCK_DEFAULT, but in reality it had better check the low-level transaction state is TRANS_DEFAULT as well. Formerly it was not possible to wait for the client in a state where the first is true and the second is not ... but now we can have such a state. Minor cleanup in StartTransaction() as well.
2003-09-28Add a mechanism to let dynamically loaded modules register post-commit/Tom Lane
post-abort cleanup hooks. I'm surprised that we have not needed this already, but I need it now to fix a plpgsql problem, and the usefulness for other dynamically loaded modules seems obvious.
2003-09-27Fix typo in message.Tom Lane
2003-09-26Various message fixes, among those fixes for the previous round of fixesPeter Eisentraut
2003-09-25Message editing: remove gratuitous variations in message wording, standardizePeter Eisentraut
terms, add some clarifications, fix some untranslatable attempts at dynamic message building.
2003-09-24Repair some REINDEX problems per recent discussions. The relcache isTom Lane
now able to cope with assigning new relfilenode values to nailed-in-cache indexes, so they can be reindexed using the fully crash-safe method. This leaves only shared system indexes as special cases. Remove the 'index deactivation' code, since it provides no useful protection in the shared- index case. Require reindexing of shared indexes to be done in standalone mode, but remove other restrictions on REINDEX. -P (IgnoreSystemIndexes) now prevents using indexes for lookups, but does not disable index updates. It is therefore safe to allow from PGOPTIONS. Upshot: reindexing system catalogs can be done without a standalone backend for all cases except shared catalogs.
2003-08-08Another pgindent run with updated typedefs.Bruce Momjian
2003-08-08Suppress unused-variable warnings when building without Asserts.Tom Lane
2003-08-04Fix some copyright notices that weren't updated. Improve copyright toolTom Lane
so it won't miss 'em again.
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-08-04pgindent run.Bruce Momjian
2003-07-28A visit from the message-style police ...Tom Lane
2003-07-21Error message editing in backend/access.Tom Lane
2003-07-19Error message editing: finish up undone task of reporting the problemTom Lane
xid when we fail to access pg_clog.
2003-07-17Repair boundary-case bug introduced by patch of two months ago thatTom Lane
fixed incorrect initial setting of StartUpID. The logic in XLogWrite() expects that Write->curridx is advanced to the next page as soon as LogwrtResult points to the end of the current page, but StartupXLOG() failed to make that happen when the old WAL ended exactly on a page boundary. Per trouble report from Hannu Krosing.
2003-06-26Add comment pointing out that XLByteToPrevSeg macro is not broken.Tom Lane
2003-06-11This patch extracts page buffer pooling and the simpleBruce Momjian
least-recently-used strategy from clog.c into slru.c. It doesn't change any visible behaviour and passes all regression tests plus a TruncateCLOG test done manually. Apart from refactoring I made a little change to SlruRecentlyUsed, formerly ClogRecentlyUsed: It now skips incrementing lru_counts, if slotno is already the LRU slot, thus saving a few CPU cycles. To make this work, lru_counts are initialised to 1 in SimpleLruInit. SimpleLru will be used by pg_subtrans (part of the nested transactions project), so the main purpose of this patch is to avoid future code duplication. Manfred Koizar
2003-05-22Repair sometimes-incorrect computation of StartUpID after a crash, perTom Lane
example from Rao Kumar. This is a very corner corner-case, requiring a minimum of three closely-spaced database crashes and an unlucky positioning of the second recovery's checkpoint record before you'd notice any problem. But the consequences are dire enough that it's a must-fix.
2003-05-14Backend support for autocommit removed, per recent discussions. TheTom Lane
only remnant of this failed experiment is that the server will take SET AUTOCOMMIT TO ON. Still TODO: provide some client-side autocommit logic in libpq.
2003-05-12Add binary I/O routines for a bunch more datatypes. Still a few to go,Tom Lane
but that was enough tedium for one day. Along the way, move the few support routines for types xid and cid into a more logical place.
2003-05-10Adjust CreateCheckpoint so that buffer dumping activities and cleanup ofTom Lane
dead xlog segments are not considered part of a critical section. It is not necessary to force a database-wide panic if we get a failure in these operations. Per recent trouble reports.
2003-05-03Handle clog structure in shared memory in exec() case, for Win32.Bruce Momjian
2003-05-02Back out last commit --- wrong patch.Bruce Momjian
2003-05-02Dump/read non-default GUC values for use by exec'ed backends, for Win32.Bruce Momjian
2003-05-02Portal and memory management infrastructure for extended query protocol.Tom Lane
Both plannable queries and utility commands are now always executed within Portals, which have been revamped so that they can handle the load (they used to be good only for single SELECT queries). Restructure code to push command-completion-tag selection logic out of postgres.c, so that it won't have to be duplicated between simple and extended queries. initdb forced due to addition of a field to Query nodes.
2003-04-26Add transaction status field to ReadyForQuery messages, and make roomTom Lane
for tableID/columnID in RowDescription. (The latter isn't really implemented yet though --- the backend always sends zeroes, and libpq just throws away the data.)
2003-04-25In the continuing saga of FE/BE protocol revisions, add reporting ofTom Lane
initial values and runtime changes in selected parameters. This gets rid of the need for an initial 'select pg_client_encoding()' query in libpq, bringing us back to one message transmitted in each direction for a standard connection startup. To allow server version to be sent using the same GUC mechanism that handles other parameters, invent the concept of a never-settable GUC parameter: you can 'show server_version' but it's not settable by any GUC input source. Create 'lc_collate' and 'lc_ctype' never-settable parameters so that people can find out these settings without need for pg_controldata. (These side ideas were all discussed some time ago in pgsql-hackers, but not yet implemented.)
2003-04-18Make Win32 tests to match existing Cygwin tests, where appropriate.Bruce Momjian
2003-04-14Reorganize clog's error reporting so that PANIC on clog I/O error canTom Lane
be reduced to a plain ERROR. Should make it at least a little less painful to deal with data-corruption problems.
2003-03-27This patch implements holdable cursors, following the proposalBruce Momjian
(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
2003-03-21Allow error query to start transaction in autocommit off mode.Bruce Momjian
2003-03-14Remove unneeded dash blocks around function start comments.Bruce Momjian
2003-03-10This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane
PostgreSQL source code. Neil Conway