Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2002-04-15The contents of command.c, creatinh.c, define.c, remove.c and rename.cTom Lane
have been divided according to the type of object manipulated - so ALTER TABLE code is in tablecmds.c, aggregate commands in aggregatecmds.c and so on. A few common support routines remain in define.c (prototypes in src/include/commands/defrem.h). No code has been changed except for includes to reflect the new files. The prototypes for aggregatecmds.c, functioncmds.c, operatorcmds.c, and typecmds.c remain in src/include/commands/defrem.h. From John Gray <jgray@azuli.co.uk>
2002-04-12Checking to decide whether relations are system relations now dependsTom Lane
on the namespace not the name; pg_ is not a reserved prefix for table names anymore. From Fernando Nasser.
2002-04-05This patch adds a missing heap_freetuple() to renamerel(), documentsBruce Momjian
the decision not to make renamerel() update the sequence name that is stored within sequences themselves (thanks to Tom Lane), and adds some rudimentary regression tests for ALTER TABLE ... RENAME on non-table relations. Neil Conway
2002-03-31Make renamerel take an OID, not a RangeVar, to identify the relationTom Lane
to rename. Avoids some corner-case bugs in cluster.c, improves consistency with renameatt.
2002-03-31Reimplement temp tables using schemas. The temp table map is history;Tom Lane
temp table entries in pg_class have the names the user would expect.
2002-03-29pg_type has a typnamespace column; system now supports creating typesTom Lane
in different namespaces. Also, cleanup work on relation namespace support: drop, alter, rename commands work for tables in non-default namespaces.
2002-03-26pg_class has a relnamespace column. You can create and access tablesTom Lane
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.
2002-03-21Change the aclchk.c routines to uniformly use OIDs to identify theTom Lane
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.
2001-11-12Indent new rename.c for Tom Lane.Bruce Momjian
2001-11-12Make ALTER TABLE RENAME update foreign-key trigger arguments correctly.Tom Lane
Brent Verner, with review and kibitzing from Tom Lane.
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-11-02Fix problem reported by Alex Korn: if a relation has been dropped andTom Lane
recreated since the start of our transaction, our first reference to it errored out because we'd try to reuse our old relcache entry for it. Do this by accepting SI inval messages just before relcache search in heap_openr, so that dead relcache entries will be flushed before we search. Also, break heap_open/openr into two pairs of routines, relation_open(r) and heap_open(r). The relation_open routines make no tests on relkind and so can be used to open anything that has a pg_class entry. The heap_open routines are wrappers that add a relkind test to preserve their established behavior. Use the relation_open routines in several places that had various kluge solutions for opening rels that might be either heap or index rels. Also, remove the old 'heap stats' code that's been superseded by Jan's stats collector, and clean up some inconsistencies in error reporting between the different types of ALTER TABLE.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-08Make ALTER TABLE RENAME COLUMN update column names of indexes thatTom Lane
refer to the renamed column. Brent Verner, with a little help from tgl.
2001-08-12Make ALTER TABLE RENAME on a view rename the view's on-select rule too.Tom Lane
Needed to keep pg_dump from getting confused.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2001-01-23Fix all the places that called heap_update() and heap_delete() withoutTom Lane
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.
2000-11-16Change SearchSysCache coding conventions so that a reference count isTom Lane
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.
2000-11-08Make DROP TABLE rollback-able: postpone physical file delete until commit.Tom Lane
(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.
2000-10-22Some small polishing of Mark Hollomon's cleanup of DROP command: mightTom Lane
as well allow DROP multiple INDEX, RULE, TYPE as well. Add missing CommandCounterIncrement to DROP loop, which could cause trouble otherwise with multiple DROP of items affecting same catalog entries. Try to bring a little consistency to various error messages using 'does not exist', 'nonexistent', etc --- I standardized on 'does not exist' since that's what the vast majority of the existing uses seem to be.
2000-10-20Clean up gcc warnings.Tom Lane
2000-10-16Remove NO_SECURITY define.Bruce Momjian
2000-10-16New file naming. Database OID is used as "tablespace" id andVadim B. Mikheev
relation OID is used as file node on creation but may be changed later if required. Regression Tests Approved (c) -:)))
2000-09-06Code cleanup of user name and user id handling in the backend. The currentPeter Eisentraut
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.
2000-06-20Make renaming a temp table behave sensibly. We don't need to touchTom Lane
the underlying table at all, just change the mapping entry ... but that logic was missing.
2000-05-25Do table renaming in a sane order: physical file rename must happenTom Lane
*last*, after all updating of system catalogs. In old code, an error detected during TypeRename left the relation hosed. Also, add a call to flush the relation's relcache entry, rather than trusting to shared cache invalidation to flush it for us.
2000-05-19Revise FlushRelationBuffers/ReleaseRelationBuffers per discussion withTom Lane
Hiroshi. ReleaseRelationBuffers now removes rel's buffers from pool, instead of merely marking them nondirty. The old code would leave valid buffers for a deleted relation, which didn't cause any known problems but can't possibly be a good idea. There were several places which called ReleaseRelationBuffers *and* FlushRelationBuffers, which is now unnecessary; but there were others that did not. FlushRelationBuffers no longer emits a warning notice if it finds dirty buffers to flush, because with the current bufmgr behavior that's not an unexpected condition. Also, FlushRelationBuffers will flush out all dirty buffers for the relation regardless of block number. This ensures that pg_upgrade's expectations are met about tuple on-row status bits being up-to-date on disk. Lastly, tweak BufTableDelete() to clear the buffer's tag so that no one can mistake it for being a still-valid buffer for the page it once held. Formerly, the buffer would not be found by buffer hashtable searches after BufTableDelete(), but it would still be thought to belong to its old relation by the routines that sequentially scan the shared-buffer array. Again I know of no bugs caused by that, but it still can't be a good idea.
2000-05-11Fix CLUSTER ... or at least undo the bit-rot it's suffered since 6.5.Tom Lane
It's still pretty fundamentally bogus :-(. Freebie side benefit: ALTER TABLE RENAME works on indexes now.
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-01-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
2000-01-22added ALTER TABLE DROP COLUMN, early versionPeter Eisentraut
1999-12-16Some changes to prepare for LONG attributes.Jan Wieck
Jan
1999-12-14fix_parsetree_attnums was not nearly smart enough about walking parseTom Lane
trees. Also rewrite find_all_inheritors() in a more intelligible style.
1999-11-25Enable pg_statistic cache use.Bruce Momjian
1999-11-24Rename heap_replace to heap_update.Bruce Momjian
1999-11-07New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian
Fewer calls to nameout. Better use of RelationGetRelationName.
1999-09-24Several changes here, not very related but touching some of the same files.Tom Lane
* Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
1999-09-18Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane
additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
1999-07-17 Move some system includes into c.h, and remove duplicates.Bruce Momjian
1999-07-16More cleanupBruce Momjian
1999-07-16Final cleanup.Bruce Momjian
1999-07-16Update #include cleanupsBruce Momjian
1999-07-15Change #include's to use <> and "" as appropriate.Bruce Momjian
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-07-15Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian
1999-05-25pgindent run over code.Bruce Momjian
1999-05-17All works on linux now by my tests and regression(with patch below).Bruce Momjian
ALTER TABLE RENAME with extents. Ole Gjerde
1999-05-10Change error messages to oids come out as %u and not %d. Change has noBruce Momjian
real affect now.
1999-03-17Add new postgres -O option to allow system table structure changes.Bruce Momjian