summaryrefslogtreecommitdiff
path: root/src/backend/utils/init
Commit message (Collapse)AuthorAgeFilesLines
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-253-21/+21
| | | | tests pass.
* Fix FindExec() for case where executable is found via a relative pathTom Lane2001-10-211-20/+10
| | | | in .:/home/postgres/testversion/bin:/opt/perl5.6.1/bin:/home/postgres/bin:/usr/local/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/bin:/opt/CC/bin:/opt/langtools/bin:/opt/graphics/phigs/bin:/opt/java/bin:/bin:/opt/imake/bin:/opt/hparray/bin:/opt/aCC/bin:/opt/lrom/bin:/usr/local/nmh/bin:. (I suppose the only common case for this is '.').
* Fix getopt-vs-init_ps_display problem by copying original argv[] info,Tom Lane2001-10-211-2/+4
| | | | | | per suggestion from Peter. Simplify several APIs by transmitting the original argv location directly from main.c to ps_status.c, instead of passing it down through several levels of subroutines.
* Set optreset on platforms that have it before launching postmasterTom Lane2001-10-191-13/+1
| | | | | | subprocesses; perhaps this will fix portability problem just noted by Lockhart. Also, move test for bad permissions of DataDir to a more logical place.
* Ensure that all startup paths (postmaster, standalone postgres, orTom Lane2001-10-192-13/+5
| | | | | | | bootstrap) check for a valid PG_VERSION file before looking at anything else in the data directory. This fixes confusing error report when trying to start current sources in a pre-7.1 data directory. Per trouble report from Rich Shepard 10/18/01.
* Add a new function "pg_client_encoding" which returns the current clientTatsuo Ishii2001-10-121-1/+7
| | | | | | side encoding name. This is necessary for client API's such as JDBC to perform correct encoding conversions. See my email "[HACKERS] pg_client_encoding" 10 Sep 2001.
* Implement new 'lightweight lock manager' that's intermediate betweenTom Lane2001-09-291-4/+5
| | | | | | | | | existing lock manager and spinlocks: it understands exclusive vs shared lock but has few other fancy features. Replace most uses of spinlocks with lightweight locks. All remaining uses of spinlocks have very short lock hold times (a few dozen instructions), so tweak spinlock backoff code to work efficiently given this assumption. All per my proposal on pghackers 26-Sep-01.
* Remove useless LockDisable() function and associated overhead, per myTom Lane2001-09-271-6/+1
| | | | proposal of 26-Aug.
* Give VACUUM its own GUC parameter for memory usage, rather thanTom Lane2001-09-211-1/+2
| | | | | piggybacking on SortMem. Add documentation for some recently-added GUC parameters that had so far escaped it.
* Make the world somewhat safe for (not from) DELETE FROM pg_shadow;Peter Eisentraut2001-09-082-5/+58
| | | | | | | | | | | | | | | | | | | | | Assign the fixed user id 1 to the user created by initdb. A stand-alone backend will always set the user id to 1. (Consequently, the name of that user is no longer important.) In stand-alone mode, the user id 1 will have implicit superuser status, to allow repairs even if there are no users defined. Print a warning message when starting in stand-alone mode when no users are defined. Disallow dropping the current user and session user. Granting/revoking superuser status also grants/revokes usecatupd. (Previously, it would never grant it back. This could lead to "deadlocks".) CREATE USER and CREATE GROUP will start allocating user ids at 100 (unless explicitly specified), to prevent accidental creation of a superuser (plus some room for future extensions).
* Get rid of PID entries in shmem hash table; there is no longer any needTom Lane2001-09-071-2/+2
| | | | | | | for them, and making them just wastes time during backend startup/shutdown. Also, remove compile-time MAXBACKENDS limit per long-ago proposal. You can now set MaxBackends as high as your kernel can stand without any reconfiguration/recompilation.
* Commit Karel's patch.Tatsuo Ishii2001-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------- Subject: Re: [PATCHES] encoding names From: Karel Zak <zakkr@zf.jcu.cz> To: Peter Eisentraut <peter_e@gmx.net> Cc: pgsql-patches <pgsql-patches@postgresql.org> Date: Fri, 31 Aug 2001 17:24:38 +0200 On Thu, Aug 30, 2001 at 01:30:40AM +0200, Peter Eisentraut wrote: > > - convert encoding 'name' to 'id' > > I thought we decided not to add functions returning "new" names until we > know exactly what the new names should be, and pending schema Ok, the patch not to add functions. > better > > ...(): encoding name too long Fixed. I found new bug in command/variable.c in parse_client_encoding(), nobody probably never see this error: if (pg_set_client_encoding(encoding)) { elog(ERROR, "Conversion between %s and %s is not supported", value, GetDatabaseEncodingName()); } because pg_set_client_encoding() returns -1 for error and 0 as true. It's fixed too. IMHO it can be apply. Karel PS: * following files are renamed: src/utils/mb/Unicode/KOI8_to_utf8.map --> src/utils/mb/Unicode/koi8r_to_utf8.map src/utils/mb/Unicode/WIN_to_utf8.map --> src/utils/mb/Unicode/win1251_to_utf8.map src/utils/mb/Unicode/utf8_to_KOI8.map --> src/utils/mb/Unicode/utf8_to_koi8r.map src/utils/mb/Unicode/utf8_to_WIN.map --> src/utils/mb/Unicode/utf8_to_win1251.map * new file: src/utils/mb/encname.c * removed file: src/utils/mb/common.c -- Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/ C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
* Replace implementation of pg_log as a relation accessed through theTom Lane2001-08-252-19/+7
| | | | | | | | | | | 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.
* Add conver/convert2 functions. They are similar to the SQL99's convert.Tatsuo Ishii2001-08-151-1/+14
|
* Seems like a bad idea to free() a string we are about to use in anTom Lane2001-08-061-9/+5
| | | | error message.
* Check that the data directory does not have group or world access; removePeter Eisentraut2001-08-061-1/+17
| | | | a similar check on postgresql.conf.
* Don't go into infinite loop if /home/postgres/testversion/data directory is ↵Tom Lane2001-07-031-4/+7
| | | | not writable.
* Handle reading of startup packet and authentication exchange after forkingPeter Eisentraut2001-06-201-4/+12
| | | | | | | | | | a new postmaster child process. This should eliminate problems with authentication blocking (e.g., ident, SSL init) and also reduce problems with the accept queue filling up under heavy load. The option to send elog output to a different file per backend (postgres -o) has been disabled for now because the initialization would have to happen in a different order and it's not clear we want to keep this anyway.
* Tweak startup sequence so that running out of PROC array slots isTom Lane2001-06-161-30/+38
| | | | | | | | | | detected sooner in backend startup, and is treated as an expected error (it gives 'Sorry, too many clients already' now). This allows us not to have to enforce the MaxBackends limit exactly in the postmaster. Also, remove ProcRemove() and fold its functionality into ProcKill(). There's no good reason for a backend not to be responsible for removing its PROC entry, and there are lots of good reasons for the postmaster not to be touching shared-memory data structures.
* has_table_privilege functions from Joe Conway (with some kibitzing fromTom Lane2001-06-141-12/+9
| | | | | | Tom Lane). For the moment, only the OID/name variants are provided. I didn't force initdb, but the additions to the 'privileges' regress test won't pass until you do one.
* Don't assume free(NULL) is OK. Yes, I know ANSI C says it is.Tom Lane2001-06-131-6/+14
|
* Clean up various to-do items associated with system indexes:Tom Lane2001-06-121-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pg_database now has unique indexes on oid and on datname. pg_shadow now has unique indexes on usename and on usesysid. pg_am now has unique index on oid. pg_opclass now has unique index on oid. pg_amproc now has unique index on amid+amopclaid+amprocnum. Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache. Remove index on pg_listener and associated syscache for performance reasons (caching rows that are certain to change before you need 'em again is rather pointless). Change pg_attrdef's nonunique index on adrelid into a unique index on adrelid+adnum. Fix various incorrect settings of pg_class.relisshared, make that the primary reference point for whether a relation is shared or not. IsSharedSystemRelationName() is now only consulted to initialize relisshared during initial creation of tables and indexes. In theory we might now support shared user relations, though it's not clear how one would get entries for them into pg_class &etc of multiple databases. Fix recently reported bug that pg_attribute rows created for an index all have the same OID. (Proof that non-unique OID doesn't matter unless it's actually used to do lookups ;-)) There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap relations. Convert them into plain system catalogs without hardwired entries in pg_class and friends. Unify global.bki and template1.bki into a single init script postgres.bki, since the alleged distinction between them was misleading and pointless. Not to mention that it didn't work for setting up indexes on shared system relations. Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do). Also, hold locks until transaction commit where necessary.
* Adjust WAL code so that checkpoints truncate the xlog at the previousTom Lane2001-06-061-2/+8
| | | | | | | | | | | | checkpoint's redo pointer, not its undo pointer, per discussion in pghackers a few days ago. No point in hanging onto undo information until we have the ability to do something with it --- and this solves a rather large problem with log space for long-running transactions. Also, change all calls of write() to detect the case where write returned a count less than requested, but failed to set errno. Presume that this situation indicates ENOSPC, and give the appropriate error message, rather than a random message associated with the previous value of errno.
* Check for malloc failure.Tom Lane2001-06-011-3/+12
|
* Remove OLD_FILE_NAMING code. No longer used.Bruce Momjian2001-05-301-4/+1
|
* Suppress compiler warnings about pid_t vs int.Tom Lane2001-05-181-3/+3
|
* Remove unused tables pg_variable, pg_inheritproc, pg_ipl tables. InitdbBruce Momjian2001-05-141-2/+1
| | | | forced.
* Make bootstrap debug messages more readable. Clean up some clutter.Peter Eisentraut2001-05-121-2/+1
|
* Noticed a small bug in the code. Probably been there for some time. NoteBruce Momjian2001-05-091-2/+4
| | | | | | | that the original code would consider things like UNIX domain sockets are regular files. Gavin Sherry
* Add SET SESSION AUTHORIZATION command.Peter Eisentraut2001-05-082-4/+31
|
* Remove useless setuid() call, instead add a check that real and effectiveTom Lane2001-04-212-9/+4
| | | | userids are the same. Per today's pghackers discussion.
* getdatabaseencoding() and PG_encoding_to_char() were being sloppy aboutTom Lane2001-04-161-3/+3
| | | | | converting char* strings to type 'name'. Imagine my surprise when 7.1 release coredumped upon start when compiled --enable-multibyte ...
* Remove dashes in comments that don't need them, rewrap with pgindent.Bruce Momjian2001-03-221-12/+11
|
* pgindent run. Make it all clean.Bruce Momjian2001-03-223-56/+69
|
* Patches from Cyril Velter to make shared-memory-conflict-detection codeTom Lane2001-03-181-2/+9
| | | | work in BeOS port.
* XLOG (and related) changes:Tom Lane2001-03-132-85/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Store two past checkpoint locations, not just one, in pg_control. On startup, we fall back to the older checkpoint if the newer one is unreadable. Also, a physical copy of the newest checkpoint record is kept in pg_control for possible use in disaster recovery (ie, complete loss of pg_xlog). Also add a version number for pg_control itself. Remove archdir from pg_control; it ought to be a GUC parameter, not a special case (not that it's implemented yet anyway). * Suppress successive checkpoint records when nothing has been entered in the WAL log since the last one. This is not so much to avoid I/O as to make it actually useful to keep track of the last two checkpoints. If the things are right next to each other then there's not a lot of redundancy gained... * Change CRC scheme to a true 64-bit CRC, not a pair of 32-bit CRCs on alternate bytes. Polynomial borrowed from ECMA DLT1 standard. * Fix XLOG record length handling so that it will work at BLCKSZ = 32k. * Change XID allocation to work more like OID allocation. (This is of dubious necessity, but I think it's a good idea anyway.) * Fix a number of minor bugs, such as off-by-one logic for XLOG file wraparound at the 4 gig mark. * Add documentation and clean up some coding infelicities; move file format declarations out to include files where planned contrib utilities can get at them. * Checkpoint will now occur every CHECKPOINT_SEGMENTS log segments or every CHECKPOINT_TIMEOUT seconds, whichever comes first. It is also possible to force a checkpoint by sending SIGUSR1 to the postmaster (undocumented feature...) * Defend against kill -9 postmaster by storing shmem block's key and ID in postmaster.pid lockfile, and checking at startup to ensure that no processes are still connected to old shmem block (if it still exists). * Switch backends to accept SIGQUIT rather than SIGUSR1 for emergency stop, for symmetry with postmaster and xlog utilities. Clean up signal handling in bootstrap.c so that xlog utilities launched by postmaster will react to signals better. * Standalone bootstrap now grabs lockfile in target directory, as added insurance against running it in parallel with live postmaster.
* Defend against starting a non-MULTIBYTE-enabled backend in a databaseTom Lane2001-02-161-5/+8
| | | | with encoding other than SQL_ASCII. Per recent discussion in pghackers.
* Re-read Unix-socket lock file every so often (every CheckPoint interval,Tom Lane2001-01-271-1/+32
| | | | | | actually) to ensure that its file access time doesn't get old enough to tempt a /tmp directory cleaner to remove it. Still another reason we should never have put the sockets in /tmp in the first place ...
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-244-8/+8
|
* Remove useless leftover global variable Ps_status_buffer.Peter Eisentraut2001-01-231-9/+1
|
* Make critical sections (elog->crash) and interrupt holdoff sectionsTom Lane2001-01-191-1/+2
| | | | into distinct concepts, per recent discussion on pghackers.
* Suppress compiler warning in MULTIBYTE code.Tom Lane2001-01-191-1/+2
|
* Minor coding cleanups.Tom Lane2001-01-141-15/+10
|
* Restructure backend SIGINT/SIGTERM handling so that 'die' interruptsTom Lane2001-01-141-4/+7
| | | | | | | are treated more like 'cancel' interrupts: the signal handler sets a flag that is examined at well-defined spots, rather than trying to cope with an interrupt that might happen anywhere. See pghackers discussion of 1/12/01.
* Add more critical-section calls: all code sections that hold spinlocksTom Lane2001-01-121-4/+5
| | | | | | | | | | | are now critical sections, so as to ensure die() won't interrupt us while we are munging shared-memory data structures. Avoid insecure intermediate states in some code that proc_exit will call, like palloc/pfree. Rename START/END_CRIT_CODE to START/END_CRIT_SECTION, since that seems to be what people tend to call them anyway, and make them be called with () like a function call, in hopes of not confusing pg_indent. I doubt that this is sufficient to make SIGTERM safe anywhere; there's just too much code that could get invoked during proc_exit().
* Fix recent breakage of query-cancel logic, see my pghackers messageTom Lane2001-01-071-2/+2
| | | | of 6 Jan 2001 21:55.
* New WAL version - CRC and data blocks backup.Vadim B. Mikheev2000-12-281-1/+47
|
* Clean up backend-exit-time cleanup behavior. Use on_shmem_exit callbacksTom Lane2000-12-181-24/+85
| | | | | | 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.
* BugfixJan Wieck2000-12-141-1/+5
| | | | | | | | Trying to connect to template0 left a global referenced buffer because the scan of pg_database wasn't ended properly before elog(FATAL). Jan
* No more #ifdef XLOG.Vadim B. Mikheev2000-11-301-16/+1
|