summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/database.c
AgeCommit message (Collapse)Author
2005-02-26Finish up the flat-files project: get rid of GetRawDatabaseInfo() hackTom Lane
in favor of looking at the flat file copy of pg_database during backend startup. This should finally eliminate the various corner cases in which backend startup fails unexpectedly because it isn't able to distinguish live and dead tuples in pg_database. Simplify locking on pg_database to be similar to the rules used with pg_shadow and pg_group, and eliminate FlushRelationBuffers operations that were used only to reduce the odds of failure of GetRawDatabaseInfo. initdb forced due to addition of a trigger to pg_database.
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-08-29Update copyright to 2004.Bruce Momjian
2004-06-18Tablespaces. Alternate database locations are dead, long live tablespaces.Tom Lane
There are various things left to do: contrib dbsize and oid2name modules need work, and so does the documentation. Also someone should think about COMMENT ON TABLESPACE and maybe RENAME TABLESPACE. Also initlocation is dead, it just doesn't know it yet. Gavin Sherry and Tom Lane.
2004-01-22Remove ExpandDatabasePath(), which is unused and must have been so sinceTom Lane
7.1, because the path interpretation it embodies has been wrong since 7.1.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-07-25Error message editing in backend/utils (except /adt).Tom Lane
2003-04-04Add Win32 path handling for / vs. \ and drive letters.Bruce Momjian
2003-03-10This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane
PostgreSQL source code. Neil Conway
2002-11-08This patch removes a bunch of superfluous #include directives: ifBruce Momjian
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
2002-09-04pgindent run.Bruce Momjian
2002-07-20oid is needed, it is added at the end of the struct (after the nullBruce Momjian
bitmap, if present). Per Tom Lane's suggestion the information whether a tuple has an oid or not is carried in the tuple descriptor. For debugging reasons tdhasoid is of type char, not bool. There are predefined values for WITHOID, WITHOUTOID and UNDEFOID. This patch has been generated against a cvs snapshot from last week and I don't expect it to apply cleanly to current sources. While I post it here for public review, I'm working on a new version against a current snapshot. (There's been heavy activity recently; hope to catch up some day ...) This is a long patch; if it is too hard to swallow, I can provide it in smaller pieces: Part 1: Accessor macros Part 2: tdhasoid in TupDesc Part 3: Regression test Part 4: Parameter withoid to heap_addheader Part 5: Eliminate t_oid from HeapTupleHeader Part 2 is the most hairy part because of changes in the executor and even in the parser; the other parts are straightforward. Up to part 4 the patched postmaster stays binary compatible to databases created with an unpatched version. Part 5 is small (100 lines) and finally breaks compatibility. Manfred Koizar
2002-06-20Update copyright to 2002.Bruce Momjian
2002-05-05A little paranoia never hurt anyone.Tom Lane
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-08-25Replace implementation of pg_log as a relation accessed through theTom Lane
buffer manager with 'pg_clog', a specialized access method modeled on pg_xlog. This simplifies startup (don't need to play games to open pg_log; among other things, OverrideTransactionSystem goes away), should improve performance a little, and opens the door to recycling commit log space by removing no-longer-needed segments of the commit log. Actual recycling is not there yet, but I felt I should commit this part separately since it'd still be useful if we chose not to do transaction ID wraparound.
2001-05-30Remove OLD_FILE_NAMING code. No longer used.Bruce Momjian
2001-05-30Remove SEP_CHAR, replace with / or '/' as appropriate.Bruce Momjian
2001-03-22Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian
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-14Another go-round on making GetRawDatabaseInfo behave as well as it can,Tom Lane
given the fundamental restriction of not looking at transaction commit data in pg_log. Use code that is actually based on tqual.c rather than ad-hoc tests. Also write the tuple fetch loop using standard access macros rather than ad-hoc code.
2000-11-14Extend CREATE DATABASE to allow selection of a template database to beTom Lane
cloned, rather than always cloning template1. Modify initdb to generate two identical databases rather than one, template0 and template1. Connections to template0 are disallowed, so that it will always remain in its virgin as-initdb'd state. pg_dumpall now dumps databases with restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0. This allows proper behavior when there is user-added data in template1. initdb forced!
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-07-03Move global internal files to PGDATA/global.Peter Eisentraut
2000-06-02Remove NT-specific file open defines by defining our own open macros forBruce Momjian
"rb" and "wb".
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-03-08Bruce and all:Bruce Momjian
Here's a patch to fix the " '.' not allowed in db path" problem I ran into. I removed '.' from the set of illegial characters, but added backtick. I also included an explicit test for attempting include a reference to a parent dir. How that? Ross
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-13Fixed everything in and surrounding createdb and dropdb to make it morePeter Eisentraut
error-proof. Rearranged some old code and removed dead sections.
1999-12-16Some changes to prepare for LONG attributes.Jan Wieck
Jan
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-10-25Standardize on MAXPGPATH as the size of a file pathname buffer,Tom Lane
eliminating some wildly inconsistent coding in various parts of the system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really convinced that there ought to be a configure-time test to set the value, go right ahead ... but I think it's a waste of time.
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-16Final cleanupBruce 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-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1999-01-17Apply Win32 patch from Horak Daniel.Bruce Momjian
1998-11-27New HeapTuple structure/interface.Vadim B. Mikheev
1998-09-03Fix ifdef.Bruce Momjian
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian
1998-09-01Renaming cleanup, no pgindent yet.Bruce Momjian
1998-08-24o note that now pg_database has a new attribuite "encoding" evenBruce Momjian
if MULTIBYTE is not enabled. So be sure to run initdb. o these patches are made against the latest source tree (after Bruce's massive patch, I think) BTW, I noticed that after running regression, the oid field of pg_type seems disappeared. regression=> select oid from pg_type; ERROR: attribute 'oid' not found this happens after the constraints test. This occures with/without my patches. strange... o pg_database_mb.h, pg_class_mb.h, pg_attribute_mb.h are no longer used, and shoud be removed. o GetDatabaseInfo() in utils/misc/database.c removed (actually in #ifdef 0). seems nobody uses. [email protected]
1998-08-19heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian
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;
1998-08-11Change owner from oid to int4 type.Bruce Momjian