aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
Commit message (Collapse)AuthorAge
...
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | 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.
* Fix relcache.c so that local relations (those created duringTom Lane1999-09-06
| | | | | | | current transaction) are not flushed by shared-cache-inval reset message. SI reset actually works now, for probably the first time in a long time. I was able to run initdb and regression tests with a 16-element SI message array, with a lot of NOTICE: cache state reset messages but no crashes.
* RelationCacheInvalidate thought there were 7 nailed-in-cacheTom Lane1999-09-06
| | | | | system tables, but actually there are only 6 --- see RelationInitialize. Kinda makes you wonder how long ago this code was last executed...
* In RelationNameGetRelation(), replace temp table name byTom Lane1999-09-04
| | | | | | real name before doing lookup. We only want to index temp tables by their real names in the relcache, to ensure there's not more than one relcache entry for them.
* Modify RelationFlushRelation so that if the relcache entryTom Lane1999-09-04
| | | | | | | | | | | has positive refcount, it is rebuilt from pg_class data. This ensures that relcache entries will track changes made by other backends. Formerly, a shared inval report would just be ignored if it happened to arrive while the relcache entry was in use. Also, fix relcache to reset ref counts to zero during transaction abort. Finally, change LockRelation() so that it checks for shared inval reports after obtaining the lock. In this way, once any kind of lock has been obtained on a rel, we can trust the relcache entry to be up-to-date.
* Repair a bunch of problems in md.c. This builds on Hiroshi'sTom Lane1999-09-02
| | | | | | | | | | | | | | | | | | | insight that RelationFlushRelation ought to invoke smgrclose, and that the way to make that work is to ensure that mdclose doesn't fail if the relation is already closed (or unlinked, if we are looking at a DROP TABLE). While I was testing that, I was able to identify several problems that we had with multiple-segment relations. The system is now able to do initdb and pass the regression tests with a very small segment size (I had it set to 64Kb per segment for testing). I don't believe that ever worked before. File descriptor leaks seem to be gone too. I have partially addressed the concerns we had about mdtruncate(), too. On a Win32 or NFS filesystem it is not possible to unlink a file that another backend is holding open, so what md.c now does is to truncate unwanted files to zero length before trying to unlink them. The other backends will be forced to close their open files by relation cache invalidation --- but I think it would take considerable work to make that happen before vacuum truncates the relation rather than after. Leaving zero-length files lying around seems a usable compromise.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Final cleanupBruce Momjian1999-07-16
|
* Update #include cleanupsBruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* Arrange for VACUUM to delete the init file that relcache.c usesTom Lane1999-05-01
| | | | | | to save a little bit of backend startup time. This way, the first backend started after a VACUUM will rebuild the init file with up-to-date statistics for the critical system indexes.
* From: Tatsuo Ishii <t-ishii@sra.co.jp>Marc G. Fournier1999-02-21
| | | | | | Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef NOT_USED" for current. I have tested these patches in that the postgres binaries are identical.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-03
|
* Add TEMP tables/indexes. Add COPY pfree(). Other cleanups.Bruce Momjian1999-02-02
|
* Relcache Size fix.Bruce Momjian1999-01-22
|
* Fix for Size sizeof in cache code.Bruce Momjian1999-01-22
|
* Apply Win32 patch from Horak Daniel.Bruce Momjian1999-01-17
|
* Initial MVCC code.Vadim B. Mikheev1998-12-15
| | | | New code for locking buffer' context.
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-27
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-01
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-01
|
* Hi all,Bruce Momjian1998-08-28
| | | | | | | | | | | | | | | | | | | | | | | I don't know if this is really related to the initdb problem discussion (haven't followed it enough). But seems so because it fixes a damn problem during index tuple insertion on CREATE TABLE into pg_attribute_relid_attnum_index. Anyway - this bug was really hard to find. During startup the relcache reads in some prepared information about index strategies from a file and then reinitializes the function pointers inside the scanKey data. But for sake it assumed single attribute index tuples (hasn't that changed recently). Thus not all the strategies scanKey entries where initialized properly, resulting in invalid addresses for the btree comparision functions. With the patch at the end the regression tests passed excellent except for the sanity_check that crashed at vacuum and the misc test where the select unique1 from onek2 outputs the two rows in different order. Jan
* heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian1998-08-19
| | | | | | | | | | | | | no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
* Change owner from oid to int4 type.Bruce Momjian1998-08-11
|
* Lmgr cleanup, new locking modes for LLL.Vadim B. Mikheev1998-08-01
|
* Use Snapshot in heap access methods.Vadim B. Mikheev1998-07-27
|
* From: t-ishii@sra.co.jpMarc G. Fournier1998-07-26
| | | | | | | | | As Bruce mentioned, this is due to the conflict among changes we made. Included patches should fix the problem(I changed all MB to MULTIBYTE). Please let me know if you have further problem. P.S. I did not include pathces to configure and gram.c to save the file size(configure.in and gram.y modified).
* I really hope that I haven't missed anything in this one...Marc G. Fournier1998-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: t-ishii@sra.co.jp Attached are patches to enhance the multi-byte support. (patches are against 7/18 snapshot) * determine encoding at initdb/createdb rather than compile time Now initdb/createdb has an option to specify the encoding. Also, I modified the syntax of CREATE DATABASE to accept encoding option. See README.mb for more details. For this purpose I have added new column "encoding" to pg_database. Also pg_attribute and pg_class are changed to catch up the modification to pg_database. Actually I haved added pg_database_mb.h, pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is enabled. The reason having separate files is I couldn't find a way to use ifdef or whatever in those files. I have to admit it looks ugly. No way. * support for PGCLIENTENCODING when issuing COPY command commands/copy.c modified. * support for SQL92 syntax "SET NAMES" See gram.y. * support for LATIN2-5 * add UNICODE regression test case * new test suite for MB New directory test/mb added. * clean up source files Basic idea is to have MB's own subdirectory for easier maintenance. These are include/mb and backend/utils/mb.
* Cleanup Name usage.Bruce Momjian1998-07-20
|
* Remove un-needed braces around single statements.Bruce Momjian1998-06-15
|
* Fix macros that were not properly surrounded by parens or braces.Bruce Momjian1998-06-15
|
* This patch...Bruce Momjian1998-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Removes the unnecessary "#define AbcRegProcedure 123"'s from pg_proc.h. 2. Changes those #defines to use the names already defined in fmgr.h. 3. Forces the make of fmgr.h in backend/Makefile instead of having it made as a dependency in access/common/Makefile *hack*hack*hack* 4. Rearranged the #includes to a less helter-skelter arrangement, also changing <file.h> to "file.h" to signify a non-system header. 5. Removed "pg_proc.h" from files where its only purpose was for the #defines removed in item #1. 6. Added "fmgr.h" to each file changed for completeness sake. Turns out that #6 was not necessary for some files because fmgr.h was being included in a roundabout way SIX levels deep by the first include. "access/genam.h" ->"access/relscan.h" ->"utils/rel.h" ->"access/strat.h" ->"access/skey.h" ->"fmgr.h" So adding fmgr.h really didn't add anything to the compile, hopefully just made it clearer to the programmer. S Darren.
* pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian1998-02-26
|
* From: Jan Wieck <jwieck@debis.com>Marc G. Fournier1998-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | The diff looks so simple and easy. But to find it wasn't fun. It must have been there for a long time. What happened: When a tuple in one of some central catalogs was updated, the referenced relation got flushed, so it would be reopened on the next access (to reflect new triggers, rules and table structure changes into the relation cache). Some data (the tupleDescriptor e.g.) is used in the system cache too. So when a relation is subject to the system cache, this must know too that a cached system relation got flushed because the tupleDesc data gets freed during the flush! For the GRANT/REVOKE on pg_class it was slightly different. There is some local data in inval.c that gets initialized on the first invalidation of a tuple in some central catalogs. This needs a SysCache lookup in pg_class. But when the first of all commands is a GRANT on pg_class, exactly the needed tuple is the one actually invalidated. So I added little code snippets that the initialization of the local variables in inval.c will already happen during InitPostgres().
* Inline fastgetattr and others so data access does not use functionBruce Momjian1998-01-31
| | | | calls.
* Thank god for searchable mail archives.PostgreSQL Daemon1998-01-15
| | | | | | | | | Patch by: wieck@sapserv.debis.de (Jan Wieck) One of the design rules of PostgreSQL is extensibility. And to follow this rule means (at least for me) that there should not only be a builtin PL. Instead I would prefer a defined interface for PL implemetations.
* Cleanup of prototypes. FIx for PQtrace start/stop several times.Bruce Momjian1998-01-14
|
* Goodbye ABORT. Hello ERROR for all errors.Bruce Momjian1998-01-07
|
* Change elog(WARN) to elog(ERROR) and elog(ABORT).Bruce Momjian1998-01-05
|
* Remove archive stuff.Bruce Momjian1997-11-21
|
* Remove all time travel stuff. Small parser cleanup.Bruce Momjian1997-11-20
|
* Remove 16 char limit on system table/index names. Rename system indexes.Bruce Momjian1997-11-17
|
* Good Bye, Time Travel!Vadim B. Mikheev1997-11-02
|
* Change column number constant to reflect change in column nameThomas G. Lockhart1997-10-25
| | | | from "action" to "ev_action".
* Inline memset() as MemSet().Bruce Momjian1997-09-18
|
* RelationBuildRuleLock(): char* --> Datum for ruleaction andVadim B. Mikheev1997-09-12
| | | | rule_evqual_string.