aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/trigger.c
Commit message (Collapse)AuthorAge
...
* Restructure aclcheck error reporting to make permission-failureTom Lane2002-04-27
| | | | | | | messages more uniform and internationalizable: the global array aclcheck_error_strings[] is gone in favor of a subroutine aclcheck_error(). Partial implementation of namespace-related permission checks --- not all done yet.
* Move renametrig() from tablecmds.c to trigger.c --- if we're going toTom Lane2002-04-26
| | | | | | | divide backend/commands by object type, let's try to pay at least minimal attention to respecting that structure, eh? Also reorder the contents of tablecmds.c; it seems odd to me to put ALTER commands before creation/deletion commands.
* pg_trigger's index on tgrelid is replaced by a unique index onTom Lane2002-04-19
| | | | | | | | | | (tgrelid, tgname). This provides an additional check on trigger name uniqueness per-table (which was already enforced by the code anyway). With this change, RelationBuildTriggers will read the triggers in order by tgname, since it's scanning using this index. Since a predictable trigger ordering has been requested for some time, document this behavior as a feature. Also document that rules fire in name order, since yesterday's changes to pg_rewrite indexing cause that too.
* Checking to decide whether relations are system relations now dependsTom Lane2002-04-12
| | | | | on the namespace not the name; pg_ is not a reserved prefix for table names anymore. From Fernando Nasser.
* Functions live in namespaces. Qualified function names work, egTom Lane2002-04-09
| | | | | SELECT schema1.func2(...). Aggregate names can be qualified at the syntactic level, but the qualification is ignored for the moment.
* Add tgconstrrelid to stored Trigger structures, make RI trigger functionsTom Lane2002-04-01
| | | | | | | | depend on this rather than the trigger argument strings to locate the other relation to test. This makes RI triggers function properly in the presence of schemas and temp tables. Along the way, fix bogus lack of locking in RI triggers, handle quoting of names fully correctly, compute required sizes of query buffers with some semblance of accuracy.
* 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.
* Mop-up some infelicities in new relation lookup handling.Tom Lane2002-03-29
|
* pg_class has a relnamespace column. You can create and access tablesTom Lane2002-03-26
| | | | | | in schemas other than the system namespace; however, there's no search path yet, and not all operations work yet on tables outside the system namespace.
* Change the aclchk.c routines to uniformly use OIDs to identify theTom Lane2002-03-21
| | | | | | objects to be privilege-checked. Some change in their APIs would be necessary no matter what in the schema environment, and simply getting rid of the name-based interface entirely seems like the best way.
* First phase of SCHEMA changes, concentrating on fixing the grammar andTom Lane2002-03-21
| | | | | | | | the parsetree representation. As yet we don't *do* anything with schema names, just drop 'em on the floor; but you can enter schema-compatible command syntax, and there's even a primitive CREATE SCHEMA command. No doc updates yet, except to note that you can now extract a field from a function-returning-row's result with (foo(...)).fieldname.
* Fix copying/equality-check bugs in GrantStmt and ConstraintsSetStmt,Tom Lane2002-03-08
| | | | | per reports from Fernando Nasser. Also, rearrange order of declarations in parsenodes.h as suggested by Fernando.
* 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
* A bunch of changes aimed at reducing backend startup time...Tom Lane2002-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Improve 'pg_internal.init' relcache entry preload mechanism so that it is safe to use for all system catalogs, and arrange to preload a realistic set of system-catalog entries instead of only the three nailed-in-cache indexes that were formerly loaded this way. Fix mechanism for deleting out-of-date pg_internal.init files: this must be synchronized with transaction commit, not just done at random times within transactions. Drive it off relcache invalidation mechanism so that no special-case tests are needed. Cache additional information in relcache entries for indexes (their pg_index tuples and index-operator OIDs) to eliminate repeated lookups. Also cache index opclass info at the per-opclass level to avoid repeated lookups during relcache load. Generalize 'systable scan' utilities originally developed by Hiroshi, move them into genam.c, use in a number of places where there was formerly ugly code for choosing either heap or index scan. In particular this allows simplification of the logic that prevents infinite recursion between syscache and relcache during startup: we can easily switch to heapscans in relcache.c when and where needed to avoid recursion, so IndexScanOK becomes simpler and does not need any expensive initialization. Eliminate useless opening of a heapscan data structure while doing an indexscan (this saves an mdnblocks call and thus at least one kernel call).
* Fix typo that caused equalTriggerDescs() to return false in cases whereTom Lane2002-01-15
| | | | | the two trigger sets were logically equal, but not in the same order. Caught by Holger Krug (hkrug@rationalizer.com).
* Require ownership permission for CREATE INDEX, per bug report.Tom Lane2002-01-03
| | | | | | | | | Disallow CREATE INDEX on system catalogs, non-tables (views, sequences, etc). Disallow CREATE/DROP TRIGGER on system catalogs, non-tables. Disallow ALTER TABLE ADD/DROP CONSTRAINT on system catalogs. Disallow FOREIGN KEY reference to non-table. None of these things can actually work in the present system structure, but the code was letting them pass without complaint.
* Remove 'triggered data change violation' error check, per recentTom Lane2001-11-16
| | | | discussions in pghackers.
* Clean up a bunch of ScanKeyEntryInitialize calls that weren't botheringTom Lane2001-11-12
| | | | to apply the proper Datum conversion macros to search key values.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Ensure that all TransactionId comparisons are encapsulated in macrosTom Lane2001-08-23
| | | | | (TransactionIdPrecedes, TransactionIdFollows, etc). First step on the way to transaction ID wrap solution ...
* Make OIDs optional, per discussions in pghackers. WITH OIDS is still theTom Lane2001-08-10
| | | | | | | | | | | | default, but OIDS are removed from many system catalogs that don't need them. Some interesting side effects: TOAST pointers are 20 bytes not 32 now; pg_description has a three-column key instead of one. Bugs fixed in passing: BINARY cursors work again; pg_class.relhaspkey has some usefulness; pg_dump dumps comments on indexes, rules, and triggers in a valid order. initdb forced.
* Fix some poor decisions about sizing of trigger-related memory contexts.Tom Lane2001-08-02
|
* Statistical system views (yet without the config stuff, butJan Wieck2001-06-22
| | | | | | | it's hard to keep such massive changes in sync with the tree so I need to get it in and work from there now). Jan
* Clean up some minor problems exposed by further thought about Panon's bugTom Lane2001-06-01
| | | | | | | | | | | | | | report on old-style functions invoked by RI triggers. We had a number of other places that were being sloppy about which memory context FmgrInfo subsidiary data will be allocated in. Turns out none of them actually cause a problem in 7.1, but this is for arcane reasons such as the fact that old-style triggers aren't supported anyway. To avoid getting burnt later, I've restructured the trigger support so that we don't keep trigger FmgrInfo structs in relcache memory. Some other related cleanups too: it's not really necessary to call fmgr_info at all while setting up the index support info in relcache entries, because those ScanKeyEntry structs are never used to invoke the functions. This should speed up relcache initialization a tiny bit.
* Make UPDATE and DELETE privileges distinct. Add REFERENCES and TRIGGERPeter Eisentraut2001-05-27
| | | | | privileges. INSERT and COPY FROM now require INSERT (only). Add privileges regression test.
* Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian2001-03-22
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Reduce amount of memory used per tuple for after-event triggers. ThisTom Lane2001-03-14
| | | | is still a memory leak, but a little less bad than it was.
* Avoid O(N^2) behavior in deferredTriggerAddEvent() for large numbers ofTom Lane2001-03-12
| | | | | | tuples inserted/deleted/updated in a single transaction. On my machine, this reduced the time to delete 80000 tuples in a foreign-key-referencing table from ~15min to ~8sec.
* Looks like I broke cases involving combinations of deferred update/deleteTom Lane2001-01-27
| | | | triggers ... oops ... but the regress tests should have covered this ...
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Fix all the places that called heap_update() and heap_delete() withoutTom Lane2001-01-23
| | | | | | | | | | | bothering to check the return value --- which meant that in case the update or delete failed because of a concurrent update, you'd not find out about it, except by observing later that the transaction produced the wrong outcome. There are now subroutines simple_heap_update and simple_heap_delete that should be used anyplace that you're not prepared to do the full nine yards of coping with concurrent updates. In practice, that seems to mean absolutely everywhere but the executor, because *noplace* else was checking.
* Clean up per-tuple memory leaks in trigger firing and plpgsqlTom Lane2001-01-22
| | | | expression evaluation.
* Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacksTom Lane2000-12-18
| | | | | | to ensure that we have released buffer refcounts and so forth, rather than putting ad-hoc operations before (some of the calls to) proc_exit. Add commentary to discourage future hackers from repeating that mistake.
* Revise handling of oldstyle/newstyle functions per recent discussionsTom Lane2000-11-20
| | | | | | | | | in pghackers list. Support for oldstyle internal functions is gone (no longer needed, since conversion is complete) and pg_language entry 'internal' now implies newstyle call convention. pg_language entry 'newC' is gone; both old and newstyle dynamically loaded C functions are now called language 'C'. A newstyle function must be identified by an associated info routine. See src/backend/utils/fmgr/README.
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-16
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* Make DROP TABLE rollback-able: postpone physical file delete until commit.Tom Lane2000-11-08
| | | | | | | | | (WAL logging for this is not done yet, however.) Clean up a number of really crufty things that are no longer needed now that DROP behaves nicely. Make temp table mapper do the right things when drop or rename affecting a temp table is rolled back. Also, remove "relation modified while in use" error check, in favor of locking tables at first reference and holding that lock throughout the statement.
* Remove NO_SECURITY define.Bruce Momjian2000-10-16
|
* Code cleanup of user name and user id handling in the backend. The currentPeter Eisentraut2000-09-06
| | | | | | | | | | | user is now defined in terms of the user id, the user name is only computed upon request (for display purposes). This is kind of the opposite of the previous state, which would maintain the user name and compute the user id for permission checks. Besides perhaps saving a few cycles (integer vs string), this now creates a single point of attack for changing the user id during a connection, for purposes of "setuid" functions, etc.
* copyObject() and equal() now know about all parse-time node types,Tom Lane2000-08-11
| | | | | | | | including utility statements. Still can't copy or compare executor state, but at present that doesn't seem to be necessary. This makes it possible to execute most (all?) utility statements in plpgsql. Had to change parsetree representation of CreateTrigStmt so that it contained only legal Nodes, and not bare string constants.
* Modify heap_open()/heap_openr() API per pghackers discussion of 11 July.Tom Lane2000-08-03
| | | | | | | | | These two routines will now ALWAYS elog() on failure, whether you ask for a lock or not. If you really want to get a NULL return on failure, call the new routines heap_open_nofail()/heap_openr_nofail(). By my count there are only about three places that actually want that behavior. There were rather more than three places that were missing the check they needed to make under the old convention :-(.
* More functions updated to new fmgr style --- money, name, tid datatypes.Tom Lane2000-08-03
| | | | | We're reaching the mopup stage here (good thing too, this is getting tedious).
* bpchar, varchar, bytea, numeric are toastable --- if you initdb, whichTom Lane2000-07-29
| | | | | | I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
* Clean up memory-context stuff, other minor infelicities.Tom Lane2000-07-03
|
* Use a private memory context to store rule information in each relcacheTom Lane2000-06-30
| | | | | | | | | | | | | | entry that has rules. This allows us to release the rule parsetrees on relcache flush without needing a working freeObject() routine. Formerly, the rule trees were leaked permanently at relcache flush. Also, clean up handling of rule creation and deletion --- there was not sufficient locking of the relation being modified, and there was no reliable notification of other backends that a relcache reload was needed. Also, clean up relcache.c code so that scans of system tables needed to load a relcache entry are done in the caller's memory context, not in CacheMemoryContext. This prevents any un-pfreed memory from those scans from becoming a permanent memory leak.
* First phase of memory management rewrite (see backend/utils/mmgr/READMETom Lane2000-06-28
| | | | | | | | | | | | | for details). It doesn't really do that much yet, since there are no short-term memory contexts in the executor, but the infrastructure is in place and long-term contexts are handled reasonably. A few long- standing bugs have been fixed, such as 'VACUUM; anything' in a single query string crashing. Also, out-of-memory is now considered a recoverable ERROR, not FATAL. Eliminate a large amount of crufty, now-dead code in and around memory management. Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and backend startup.
* Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian2000-06-08
|
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-30
|
* Second round of fmgr changes: triggers are now invoked in new style,Tom Lane2000-05-29
| | | | CurrentTriggerData is history.