aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam
Commit message (Collapse)AuthorAge
* This patch implements FOR EACH STATEMENT triggers, per my email toBruce Momjian2002-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -hackers a couple days ago. Notes/caveats: - added regression tests for the new functionality, all regression tests pass on my machine - added pg_dump support - updated PL/PgSQL to support per-statement triggers; didn't look at the other procedural languages. - there's (even) more code duplication in trigger.c than there was previously. Any suggestions on how to refactor the ExecXXXTriggers() functions to reuse more code would be welcome -- I took a brief look at it, but couldn't see an easy way to do it (there are several subtly-different versions of the code in question) - updated the documentation. I also took the liberty of removing a big chunk of duplicated syntax documentation in the Programmer's Guide on triggers, and moving that information to the CREATE TRIGGER reference page. - I also included some spelling fixes and similar small cleanups I noticed while making the changes. If you'd like me to split those into a separate patch, let me know. Neil Conway
* Put back error test for DECLARE CURSOR outside a transaction block ...Tom Lane2002-11-18
| | | | but do it correctly now.
* Update xact.c comments for clarity.Bruce Momjian2002-11-13
|
* Code review for ON COMMIT patch. Make the actual on-commit action happenTom Lane2002-11-11
| | | | | | | | | before commit, not after :-( --- the original coding is not only unsafe if an error occurs while it's processing, but it generates an invalid sequence of WAL entries. Resurrect 7.2 logic for deleting items when no longer needed. Use an enum instead of random macros. Editorialize on names used for routines and constants. Teach backend/nodes routines about new field in CreateTable struct. Add a regression test.
* Add code to handle [ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP }]Bruce Momjian2002-11-09
| | | | | | for temp tables. Gavin Sherry
* This patch removes a bunch of superfluous #include directives: ifBruce Momjian2002-11-08
| | | | | | | | postgres.h or c.h includes a system header (such as stdio.h or stdlib.h), there's no need to specifically include it in any of the .c files in the backend. Neil Conway
* Clean up a few fprintf(stderr)'s that should be elog's.Tom Lane2002-11-02
|
* Perform transaction cleanup operations in a less ad-hoc, moreTom Lane2002-10-22
| | | | | | | | | | | principled order; in particular ensure that all shared resources are released before we release transaction locks. The code used to release locks before buffer pins, which might explain an ancient note I have about a bufmgr assertion failure I'd seen once several years ago, and been unable to reproduce since. (Theory: someone trying to drop a relation might be able to reach FlushRelationBuffers before the last user of the relation had gotten around to dropping his buffer pins.)
* Fix places that were using IsTransactionBlock() as an (inadequate) checkTom Lane2002-10-21
| | | | | | that they'd get to commit immediately on finishing. There's now a centralized routine PreventTransactionChain() that implements the necessary tests.
* Make CREATE/ALTER/DROP USER/GROUP transaction-safe, or at least prettyTom Lane2002-10-21
| | | | | nearly so, by postponing write of flat password file until transaction commit.
* Change order of operations during XLogFlush so that we try to includeTom Lane2002-10-07
| | | | | | | in our write/flush operation any WAL entries that got queued while we were waiting to get the WALWriteLock. This improves throughput when transactions are small enough that several can be committed per WAL write (ie, per disk revolution).
* Ensure that before truncating CLOG, we force a checkpoint even if noTom Lane2002-09-26
| | | | | | recent WAL activity has occurred. Without this, it's possible that a later crash might leave tuples on disk with un-updated commit status bits.
* pgindent run.Bruce Momjian2002-09-04
|
* Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian2002-09-02
| | | | because c.h has sys/types.h.
* Remove code that suggested increasing wal_files.Bruce Momjian2002-09-01
|
* AUTOCOMMIT mode is now an available backend GUC variable; setting itTom Lane2002-08-30
| | | | | | | | | to false provides more SQL-spec-compliant behavior than we had before. I am not sure that setting it false is actually a good idea yet; there is a lot of client-side code that will probably be broken by turning autocommit off. But it's a start. Loosely based on a patch by David Van Wie.
* Complete TODO item:Bruce Momjian2002-08-30
| | | | | * Remove wal_files postgresql.conf option because WAL files are now recycled
* Reverse out XLogDir/-X write-ahead log handling, per discussion.Bruce Momjian2002-08-17
| | | | Original patch from Thomas.
* Restructure local-buffer handling per recent pghackers discussion.Tom Lane2002-08-06
| | | | | | | | | | | | | | The local buffer manager is no longer used for newly-created relations (unless they are TEMP); a new non-TEMP relation goes through the shared bufmgr and thus will participate normally in checkpoints. But TEMP relations use the local buffer manager throughout their lifespan. Also, operations in TEMP relations are not logged in WAL, thus improving performance. Since it's no longer necessary to fsync relations as they move out of the local buffers into shared buffers, quite a lot of smgr.c/md.c/fd.c code is no longer needed and has been removed: there's no concept of a dirty relation anymore in md.c/fd.c, and we never fsync anything but WAL. Still TODO: improve local buffer management algorithms so that it would be reasonable to increase NLocBuffer.
* Fix compilation problem with assert checking enabled for recent xlogThomas G. Lockhart2002-08-05
| | | | location feature.
* Implement WAL log location control using "-X" or PGXLOG.Thomas G. Lockhart2002-08-04
|
* When compiling with --enable-cassert, check for reference count leaksTom Lane2002-08-02
| | | | | | | in the relcache. It's rather silly that we have reference count leak checks in bufmgr and in catcache, but not in relcache which will normally have many fewer entries. Chris K-L would have caught at least one bug in his recent DROP patch if he'd had this.
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* Remove some pre-WAL relics:Bruce Momjian2002-06-15
| | | | | | | | | SharedBufferChanged BufferRelidLastDirtied BufferTagLastDirtied BufferDirtiedByMe Manfred Koizar
* This patch wraps all accesses to t_xmin, t_cmin, t_xmax, and t_cmax inBruce Momjian2002-06-15
| | | | | | | | | | | HeapTupleHeaderData in setter and getter macros called HeapTupleHeaderGetXmin, HeapTupleHeaderSetXmin etc. It also introduces a "virtual" field xvac by defining HeapTupleHeaderGetXvac and HeapTupleHeaderSetXvac. Xvac is used by VACUUM, in fact it is stored in t_cmin. Manfred Koizar
* Katherine Ward wrote:Jan Wieck2002-06-11
| | | | | | | | | | | | | | > Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
* The attached patch fixes a problem with InstallXLogFileSegment()'s useBruce Momjian2002-06-07
| | | | | | | | | | | | | | | | | | | | | | of link() under Cygwin: http://archives.postgresql.org/pgsql-cygwin/2002-04/msg00072.php Note that it appears that BeOS and Netware also have the above or similar problem. I have only verified that PostgreSQL builds under Cygwin with this patch. Since I cannot reproduce the problem, I cannot verify that the proposed patch solves it. Nevertheless, both Barry Pederson and David P. Caldwell attest that this patch solves the problem. See the following for details: http://archives.postgresql.org/pgsql-cygwin/2002-05/msg00043.php http://archives.postgresql.org/pgsql-cygwin/2002-05/msg00040.php Jason Tishler
* Remove AMI_OVERRIDE tests from tqual.c routines; they aren't necessaryTom Lane2002-05-25
| | | | | and just slow down normal operations (only fractionally, but a cycle saved is a cycle earned). Improve documentation of AMI_OVERRIDE behavior.
* Modify sequence state storage to eliminate dangling-pointer problemTom Lane2002-05-22
| | | | | | | | exemplified by bug #671. Moving the storage to relcache turned out to be a bad idea because relcache might decide to discard the info. Instead, open and close the relcache entry on each sequence operation, and use a record of the current XID to discover whether we already hold AccessShareLock on the sequence.
* Remove global variable scanCommandId in favor of storing a command IDTom Lane2002-05-21
| | | | | | | | | | | in snapshots, per my proposal of a few days ago. Also, tweak heapam.c routines (heap_insert, heap_update, heap_delete, heap_mark4update) to be passed the command ID to use, instead of doing GetCurrentCommandID. For catalog updates they'll still get passed current command ID, but for updates generated from the main executor they'll get passed the command ID saved in the snapshot the query is using. This should fix some corner cases associated with functions and triggers that advance current command ID while an outer query is still in progress.
* Support temporary setting of search path during CREATE SCHEMA; thisTom Lane2002-05-17
| | | | | | | allows the example in the CREATE SCHEMA ref page to actually work now. Also, clean up when the transaction that initially creates a temp-table namespace is later aborted. Simplify internal representation of search path by folding special cases into the main list.
* Merge the last few variable.c configuration variables into the genericTom Lane2002-05-17
| | | | | | | | | GUC support. It's now possible to set datestyle, timezone, and client_encoding from postgresql.conf and per-database or per-user settings. Also, implement rollback of SET commands that occur in a transaction that later fails. Create a SET LOCAL var = value syntax that sets the variable only for the duration of the current transaction. All per previous discussions in pghackers.
* Make initdb print a message about which locale it is about to use.Peter Eisentraut2002-05-09
| | | | | Re-add warning if the locale prevents LIKE-optimization. Done within initdb now.
* xlog.c: If possible please add the following patch to better support NetWare.Bruce Momjian2002-04-24
| | | | Ulrich Neumann
* Add fields in the control file to check for whether the backend wasThomas G. Lockhart2002-04-21
| | | | | | | | compiled for integer date/time storage and to check the length of storage for the locale fields in the same data structure. Slightly reword some of the error messages to be more accurate on possible recovery options (e.g. recompile *or* re-initdb). Bump version number on this file.
* Locale support is on by default. The choice of locale is done in initdbPeter Eisentraut2002-04-03
| | | | and/or with GUC variables.
* Create a new GUC variable search_path to control the namespace searchTom Lane2002-04-01
| | | | | | | path. The default behavior if no per-user schemas are created is that all users share a 'public' namespace, thus providing behavior backwards compatible with 7.2 and earlier releases. Probably the semantics and default setting will need to be fine-tuned, but this is a start.
* Reimplement temp tables using schemas. The temp table map is history;Tom Lane2002-03-31
| | | | temp table entries in pg_class have the names the user would expect.
* Repair two problems with WAL logging of sequence nextvalI() ops, asTom Lane2002-03-15
| | | | | | per recent pghackers discussion: force a new WAL record at first nextval after a checkpoint, and ensure that xlog is flushed to disk if a nextval record is the only thing emitted by a transaction.
* Change made to elog:Bruce Momjian2002-03-06
| | | | | | | | | | | | | | | | | | | o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* Add better error text:Bruce Momjian2002-02-18
| | | | | elog(LOG, "XLogWrite: new log file created - " "consider increasing 'wal_files' in postgresql.conf.");
* Reduce severity of 'XLogFlush: request is not satisfied' error condition,Tom Lane2002-01-14
| | | | | | per my proposal of a couple days ago. This will eliminate the unable- to-restart-database class of problem that we have seen reported half a dozen times with 7.1.*.
* Ensure that all direct uses of spinlock-protected data structures useTom Lane2001-12-28
| | | | | | | | | | | 'volatile' pointers to access those structures, so that optimizing compilers will not decide to move the structure accesses outside of the spinlock-acquire-to-spinlock-release sequence. There are no known bugs in these uses at present, but based on bad experience with lwlock.c, it seems prudent to ensure that we protect these other uses too. Per pghackers discussion around 12-Dec. (Note: it should not be necessary to worry about structures protected by LWLocks, since the LWLock acquire and release operations are not inline macros.)
* Fix mispeling ...Tom Lane2001-12-23
|
* Temporarily dike out GetUndoRecPtr() in checkpoint generation, since weTom Lane2001-12-19
| | | | | | do not use the undo pointer anyway. This is a quick-hack solution for the three-way deadlock condition discussed in pghackers 17-Dec-01. Need to find a better way of doing it.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* Merge three existing ways of signaling postmaster from child processes,Tom Lane2001-11-04
| | | | | | | | | | | so that only one signal number is used not three. Flags in shared memory tell the reason(s) for the current signal. This method is extensible to handle more signal reasons without chewing up even more signal numbers, but the immediate reason is to keep pg_pwd reloads separate from SIGHUP processing in the postmaster. Also clean up some problems in the postmaster with delayed response to checkpoint status changes --- basically, it wouldn't schedule a checkpoint if it wasn't getting connection requests on a regular basis.
* Add missing #include.Tom Lane2001-11-01
|
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.