summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
Commit message (Collapse)AuthorAgeFilesLines
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-252-581/+592
| | | | tests pass.
* Further cleanup of ps_status setup code. On platforms where theTom Lane2001-10-222-17/+3
| | | | | | | | environment strings need to be moved around, do so when called from initial startup (main.c), not in init_ps_status. This eliminates the former risk of invalidating saved environment-string pointers, since no code has yet had a chance to grab any such pointers when main.c is running.
* Fix getopt-vs-init_ps_display problem by copying original argv[] info,Tom Lane2001-10-212-49/+39
| | | | | | 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.
* Proper fix for glibc getopt() botch. Surprising we did not see thisTom Lane2001-10-191-16/+28
| | | | before.
* Set optreset on platforms that have it before launching postmasterTom Lane2001-10-191-3/+28
| | | | | | 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-191-6/+6
| | | | | | | 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.
* Move init_ps_display from postgres.c to postmaster.c, putting itTom Lane2001-10-191-11/+123
| | | | | | | | | | | just after receipt of the startup packet. Now, postmaster children that are waiting for client authentication response will show as 'postgres: user database host authentication'. Also, do an init_ps_display for startup/shutdown/checkpoint subprocesses, so that they are readily identifiable as well. Fix an obscure race condition that could lead to Assert failure in the postmaster --- attempting to start a checkpoint process before any connections have been received led to calling PostmasterRandom before setting random_seed.
* Make sure to clean out old activity string when recycling a backend entry.Tom Lane2001-10-161-1/+2
|
* Further cleanup of dynahash.c API, in pursuit of portability andTom Lane2001-10-051-131/+58
| | | | | | | | | readability. Bizarre '(long *) TRUE' return convention is gone, in favor of just raising an error internally in dynahash.c when we detect hashtable corruption. HashTableWalk is gone, in favor of using hash_seq_search directly, since it had no hope of working with non-LONGALIGNable datatypes. Simplify some other code that was made undesirably grotty by promixity to HashTableWalk.
* Consistently use gcc's __attribute__((format)) to check sprintf-styleTom Lane2001-10-031-7/+3
| | | | | format strings wherever possible. Remarkably, this exercise didn't turn up any inconsistencies, but it seems a good idea for the future.
* Clean up a little more carefully around fork of pgstat subprocess.Tom Lane2001-10-011-1/+26
| | | | | | Partial support for BEOS (not sure whether second fork of grandchild process needs these extra calls or not; someone who has BEOS will need to test it).
* Another round of cleanups for dynahash.c (maybe it's finally clean ofTom Lane2001-10-011-51/+58
| | | | | | | | | portability issues). Caller-visible data structures are now allocated on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'. Rejigger hash_create API so that caller specifies size of key and total size of entry, not size of key and size of rest of entry. This simplifies life considerably since each number is just a sizeof(), and padding issues etc. are taken care of automatically.
* ISTM that IsUnderPostmaster should mean we are a child process of theTom Lane2001-09-301-3/+5
| | | | postmaster ... it should not be set in the postmaster itself.
* Code review for MD5 authorization patch. Clean up some breakageTom Lane2001-09-211-12/+29
| | | | (salts were always zero!?), add much missing documentation.
* Add an overall timeout on the client authentication cycle, so thatTom Lane2001-09-211-4/+30
| | | | | | | a hung client or lost connection can't indefinitely block a postmaster child (not to mention the possibility of deliberate DoS attacks). Timeout is controlled by new authentication_timeout GUC variable, which I set to 60 seconds by default ... does that seem reasonable?
* Clean up some confusion about where and how to set whereToSendOutput.Tom Lane2001-09-081-3/+14
| | | | | | | | We will no longer try to send elog messages to the client before we have initialized backend libpq (oops); however, reporting bogus commandline switches via elog does work now (not irrelevant, because of PGOPTIONS). Fix problem with inappropriate sending of checkpoint-process messages to stderr.
* Enable SIGTERM and SIGQUIT during client authentication soJan Wieck2001-09-071-3/+17
| | | | | | | the postmaster can kill the forked off processes when shutdown is requested. Jan
* Missed a few places that referred to a compile-time limit onTom Lane2001-09-071-6/+2
| | | | max_connections.
* Get rid of PID entries in shmem hash table; there is no longer any needTom Lane2001-09-071-6/+6
| | | | | | | 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.
* Convert some fprintf's to elog's.Peter Eisentraut2001-08-301-80/+115
|
* Ensure that all TransactionId comparisons are encapsulated in macrosTom Lane2001-08-231-11/+11
| | | | | (TransactionIdPrecedes, TransactionIdFollows, etc). First step on the way to transaction ID wrap solution ...
* Add 4-byte MD5 salt.Bruce Momjian2001-08-171-6/+13
|
* Endeavor to make pgstats buffer process (a) safe and (b) useful.Tom Lane2001-08-052-153/+279
| | | | | | | | Make sure it exits immediately when collector process dies --- in old code, buffer process would hang around and compete with the new buffer process for packets. Make sure it doesn't block on writing the pipe when the collector falls more than a pipeload behind. Avoid leaking pgstats FDs into every backend.
* Fix handling of SIGCHLD, per recent pghackers discussion: on someTom Lane2001-08-042-58/+76
| | | | | | | platforms system(2) gets confused unless the signal handler is set to SIG_DFL, not SIG_IGN. pgstats.c now uses pqsignal() as it should, not signal(). Also, arrange for the stats collector process to show a reasonable ID in 'ps', rather than looking like a postmaster.
* Cleanup code for preparsing pg_hba.conf and pg_ident.conf. Store lineTom Lane2001-07-311-7/+23
| | | | | | | | | number in the data structure so that we can give at least a minimally useful idea of where the mistake is when we issue syntax error messages. Move the ClientAuthentication() call to where it should have been in the first place, so that postmaster memory releasing can happen in a reasonable place also. Update obsolete comments, correct one real bug (auth_argument was not picked up correctly).
* Load pg_hba.conf and pg_ident.conf on startup and SIGHUP into List ofBruce Momjian2001-07-301-14/+6
| | | | | | Lists, and use that for user validation. Bruce Momjian
* Added GUC configuration options to control access statistics.Jan Wieck2001-07-051-8/+51
| | | | Jan
* Start the stats collector at a less randomly chosen time. Bad ideaTom Lane2001-07-031-9/+9
| | | | | to start it before we have acquired the data directory lock; also a bad idea to start it before we have set up to catch SIGCHLD signals.
* Under new theory of operation wherein postmaster forks childrenTom Lane2001-07-011-10/+15
| | | | | | | | | | | immediately, we will fork a child even if the database state does not permit connections to be accepted (eg, we are in recovery mode). The child process will correctly reject the connection and exit as soon as it's finished collecting the connection request message. However, this means that reaper() must be prepared to see child process exit signals even while it's waiting for startup or shutdown process to finish. As was, a connection request arriving during a database recovery or shutdown would cause postmaster abort.
* portability enhancementsPeter Eisentraut2001-06-301-11/+9
|
* Turned high-frequently called pgstat functions into macrosJan Wieck2001-06-291-225/+1
| | | | | | for speed. Jan
* Fix erroneous GUC variable references from commandline-GUC patch.Tom Lane2001-06-291-5/+5
|
* Fix a couple remaining places where GUC variables were assigned toTom Lane2001-06-251-4/+2
| | | | directly, rather than through SetConfigOption().
* > Marko Kreen <marko@l-t.ee> writes:Bruce Momjian2001-06-231-16/+12
| | | | | | | | | | | | | > > secure_ctx changes too. it will be PGC_BACKEND after '-p'. > > Oh, okay, I missed that part. Could we see the total state of the > patch --- ie, a diff against current CVS, not a bunch of deltas? > I've gotten confused about what's in and what's out. Ok, here it is. Cleared the ctx comment too - after -p it will be PGC_BACKEND in any case. Marko Kreen
* The new files for statistical system views.Jan Wieck2001-06-221-0/+2809
| | | | Jan
* Statistical system views (yet without the config stuff, butJan Wieck2001-06-222-3/+35
| | | | | | | 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
* A bit of code beautification/cleanup of obsolete comments. RethinkTom Lane2001-06-211-48/+64
| | | | ordering of startup operations in one or two places.
* Handle reading of startup packet and authentication exchange after forkingPeter Eisentraut2001-06-201-285/+118
| | | | | | | | | | 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.
* Back out SET ALL patch because it is breaking things.Bruce Momjian2001-06-191-12/+16
|
* RESET ALL secondary patch:Bruce Momjian2001-06-181-16/+12
| | | | | | | | | | Here is Tomified version of my 2 pending patches. Dropped the set_.._real change as it is not needed. Desc would be: * use GUC for settings from cmdline Marko Kreen
* Tweak startup sequence so that running out of PROC array slots isTom Lane2001-06-161-15/+11
| | | | | | | | | | 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.
* Add missing PG_SETMASK(&BlockSig) to SIGHUP_handler().Tom Lane2001-06-141-8/+9
|
* Extend GUC concepts of parse_hook and assign_hook to all four supportedTom Lane2001-06-121-3/+7
| | | | | | | | | | | | datatypes, not only strings. parse_hook is useless for bool, I suppose, but it seems possibly useful for int and double to apply variable-specific constraints that are more complex than simple range limits. assign_hook is definitely useful for all datatypes --- we need it right now for bool to support date cache reset when changing Australian timezone rule setting. Also, clean up some residual problems with the reset all/show all patch, including memory leaks and mistaken reset of PostPortNumber. It seems best that RESET ALL not touch variables that don't have SUSET or USERSET context.
* Move temporary files into 'pg_tempfiles' subdirectory of each databaseTom Lane2001-06-111-6/+18
| | | | | | directory (which can be made a symlink to put temp files on another disk). Add code to delete leftover temp files during postmaster startup. Bruce, with some kibitzing from Tom.
* reset all: command line and .conf options change defaultsBruce Momjian2001-06-071-2/+2
| | | | | | | | | | on RESET ALL those are restored. show all: GUC + non-GUC. SHOW ALL, RESET ALL Marko Kreen
* Mark many strings in backend not covered by elog for translation. Also,Peter Eisentraut2001-06-031-103/+108
| | | | make strings in xlog.c look more like English and less like binary noise.
* Remove SEP_CHAR, replace with / or '/' as appropriate.Bruce Momjian2001-05-301-3/+2
|
* Oops, only wanted python change in the last commit. Backing out.Bruce Momjian2001-05-251-54/+1
|
* While changing Cygwin Python to build its core as a DLL (like Win32Bruce Momjian2001-05-251-1/+54
| | | | | | | | | | | | | | | Python) to support shared extension modules, I have learned that Guido prefers the style of the attached patch to solve the above problem. I feel that this solution is particularly appropriate in this case because the following: PglargeType PgType PgQueryType are already being handled in the way that I am proposing for PgSourceType. Jason Tishler
* Add extern int optreset declaration, per bug report from <info@decc.nl>.Peter Eisentraut2001-04-191-1/+4
|