Commit Graph

55 Commits

Author SHA1 Message Date
Tom Lane f00da6d841 Allow the postmaster to accept changes in PGC_BACKEND GUC variables
from the config file, so that these changes will propagate to backends
started later.  Already-started backends continue to ignore changes
in these variables.
2001-09-30 20:16:21 +00:00
Tom Lane f9f258281e Create a GUC parameter max_files_per_process that is a configurable
upper limit on what we will believe from sysconf(_SC_OPEN_MAX).  The
default value is 1000, so that under ordinary conditions it won't
affect the behavior.  But on platforms where the kernel promises far
more than it can deliver, this can be used to prevent running out of
file descriptors.  See numerous past discussions, eg, pgsql-hackers
around 23-Dec-2000.
2001-09-30 18:57:45 +00:00
Tom Lane 499abb0c0f Implement new 'lightweight lock manager' that's intermediate between
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.
2001-09-29 04:02:27 +00:00
Peter Eisentraut c0a9283742 Rename collect_* options to more user-friendly names. 2001-09-23 21:52:36 +00:00
Tom Lane 35b7601b04 Add an overall timeout on the client authentication cycle, so that
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?
2001-09-21 17:06:12 +00:00
Tom Lane c969fed7ec Give VACUUM its own GUC parameter for memory usage, rather than
piggybacking on SortMem.  Add documentation for some recently-added
GUC parameters that had so far escaped it.
2001-09-21 03:32:36 +00:00
Peter Eisentraut a1ee06625c Provide tunable knob for x = NULL -> x IS NULL transformation, default to off. 2001-09-20 14:20:28 +00:00
Peter Eisentraut dfdbf6898f max_locks_per_transaction seems to be a more consistent name than
max_locks_per_xact.
2001-09-12 14:06:37 +00:00
Tom Lane 863aceb54f Get rid of PID entries in shmem hash table; there is no longer any need
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.
2001-09-07 00:27:30 +00:00
Bruce Momjian 38bb1abcda Use MD5 for wire protocol encryption for >= 7.2 client/server.
Allow pg_shadow to be MD5 encrypted.
Add ENCRYPTED/UNENCRYPTED option to CREATE/ALTER user.
Add password_encryption postgresql.conf option.
Update wire protocol version to 2.1.
2001-08-15 18:42:16 +00:00
Jan Wieck 6497a7fd71 Added GUC configuration options to control access statistics.
Jan
2001-07-05 15:19:40 +00:00
Peter Eisentraut 10e9cd2299 Allow default transaction isolation level (a.k.a. set session
characteristics) to be set through GUC.
2001-06-30 22:03:26 +00:00
Tom Lane e0c9301c87 Install infrastructure for shared-memory free space map. Doesn't actually
do anything yet, but it has the necessary connections to initialization
and so forth.  Make some gestures towards allowing number of blocks in
a relation to be BlockNumber, ie, unsigned int, rather than signed int.
(I doubt I got all the places that are sloppy about it, yet.)  On the
way, replace the hardwired NLOCKS_PER_XACT fudge factor with a GUC
variable.
2001-06-27 23:31:40 +00:00
Bruce Momjian 6a7f23c213 > Marko Kreen <marko@l-t.ee> writes:
> > 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
2001-06-23 22:23:49 +00:00
Bruce Momjian 2e81f3d204 Back out SET ALL patch because it is breaking things. 2001-06-19 23:40:10 +00:00
Bruce Momjian 3709a5ada7 RESET ALL secondary patch:
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
2001-06-18 23:42:32 +00:00
Bruce Momjian 7dac778561 Add GUC setting for Australian timezones. Uses new GUC boolean callback
functions to clear date cache.  Allow regression tests to pass when
timezone set.
2001-06-18 16:14:44 +00:00
Tom Lane 2938eec7fe Extend GUC concepts of parse_hook and assign_hook to all four supported
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.
2001-06-12 22:54:06 +00:00
Bruce Momjian 4ee76ad884 reset all: command line and .conf options change defaults
on RESET ALL those are restored.

show all: GUC + non-GUC.

SHOW ALL, RESET ALL

Marko Kreen
2001-06-07 04:50:57 +00:00
Peter Eisentraut 761a0bb69b Add dynamic_library_path parameter and automatic appending of shared
library extension.
2001-05-17 17:44:18 +00:00
Tom Lane b32cac8055 Fix Joubert's complaint that int8-sized numeric literals are mishandled
on Alpha (because parser mistakenly assumes that a nonoverflow result
from strtol means the value will fit into int4).  A scan for other uses
of strtol and strtoul found a couple other places with the same mistake;
fix them too.  The changes are all conditional on HAVE_LONG_INT_64 to
avoid complaints from compilers that think x != x is a silly test
(cf. pg_atoi).
2001-03-22 17:41:47 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Tom Lane 9d645fd84c Support syncing WAL log to disk using either fsync(), fdatasync(),
O_SYNC, or O_DSYNC (as available on a given platform).  Add GUC parameter
to control sync method.
Also, add defense to XLogWrite to prevent it from going nuts if passed
a target write position that's past the end of the buffers so far filled
by XLogInsert.
2001-03-16 05:44:33 +00:00
Tom Lane 4d14fe0048 XLOG (and related) changes:
* 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.
2001-03-13 01:17:06 +00:00
Tom Lane 9c9936587c Implement COMMIT_SIBLINGS parameter to allow pre-commit delay to occur
only if at least N other backends currently have open transactions.  This
is not a great deal of intelligence about whether a delay might be
profitable ... but it beats no intelligence at all.  Note that the default
COMMIT_DELAY is still zero --- this new code does nothing unless that
setting is changed.
Also, mark ENABLEFSYNC as a system-wide setting.  It's no longer safe to
allow that to be set per-backend, since we may be relying on some other
backend's fsync to have synced the WAL log.
2001-02-26 00:50:08 +00:00
Tom Lane 57e0847180 Change default commit_delay to zero, update documentation. 2001-02-18 04:50:43 +00:00
Vadim B. Mikheev 608ddb7503 FixBTree flag still exists and may be used to turn
runtime recovery OFF.
2001-02-07 23:36:22 +00:00
Bruce Momjian 7df3bb50f0 Add all possible config file options. 2001-01-24 18:37:31 +00:00
Vadim B. Mikheev 4b59366e57 1. Checkpoint.undo may be after checkpoint itself:
- no more elog(STOP) in StartupXLOG();
   - both checkpoint' undo & redo are used to define
     oldest on-line log file.
2. Ability to pre-allocate a few log files at checkpoint time
   (wal_files option). Off by default.
2001-01-09 06:24:33 +00:00
Peter Eisentraut 13dbd0276a Final(?) GUC clean-up. Update psql tab completion. 2000-12-03 14:36:47 +00:00
Vadim B. Mikheev 741510521c XLOG stuff for sequences.
CommitDelay in guc.c
2000-11-30 01:47:33 +00:00
Tom Lane 792b0f4666 Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the Unix
socket file, in favor of having an ordinary lockfile beside the socket file.
Clean up a few robustness problems in the lockfile code.  If postmaster is
going to reject a connection request based on database state, it will now
tell you so before authentication exchange not after.  (Of course, a failure
after is still possible if conditions change meanwhile, but this makes life
easier for a yet-to-be-written pg_ping utility.)
2000-11-29 20:59:54 +00:00
Bruce Momjian 9d5098ca78 Rename GUC name from unixsocket to unix_socket_directory 2000-11-25 04:13:18 +00:00
Vadim B. Mikheev a221d95f28 Compile WAL by default. 2000-11-20 05:18:40 +00:00
Peter Eisentraut 76920de895 Rename parameter "hostname" to "virtual_host". Seemed very ambiguous... 2000-11-15 18:36:06 +00:00
Peter Eisentraut 0937bf9544 Small polishing of syslog facility and ident settings. Only allow setting
at postmaster start, rename syslog_progid to syslog_ident, since syslog
itself uses that term, fix doc markup.
2000-11-14 19:13:27 +00:00
Bruce Momjian 026643a6e7 Rename PortName to PortNumber. 2000-11-14 01:15:06 +00:00
Bruce Momjian d63a762f79 Ok, You guys are probably tired of me, BUT, here is another one, that
adds the facility to set the program name used in syslog.
(this includes the other ones).

One gotcha, the parser doesn't like special characters in strings.
For example, i tried to use pg-test, and if failed the parse coming
from the postgresql.conf file.

I don't think it's a showstopper..

Larry Rosenman
2000-11-13 21:35:03 +00:00
Bruce Momjian 2150c2edf1 UUNET is looking into offering PostgreSQL as a part of a managed web
hosting product, on both shared and dedicated machines.  We currently
offer Oracle and MySQL, and it would be a nice middle-ground.
However, as shipped, PostgreSQL lacks the following features we need
that MySQL has:

1. The ability to listen only on a particular IP address.  Each
   hosting customer has their own IP address, on which all of their
   servers (http, ftp, real media, etc.) run.
2. The ability to place the Unix-domain socket in a mode 700 directory.
   This allows us to automatically create an empty database, with an
   empty DBA password, for new or upgrading customers without having
   to interactively set a DBA password and communicate it to (or from)
   the customer.  This in turn cuts down our install and upgrade times.
3. The ability to connect to the Unix-domain socket from within a
   change-rooted environment.  We run CGI programs chrooted to the
   user's home directory, which is another reason why we need to be
   able to specify where the Unix-domain socket is, instead of /tmp.
4. The ability to, if run as root, open a pid file in /var/run as
   root, and then setuid to the desired user.  (mysqld -u can almost
   do this; I had to patch it, too).

The patch below fixes problem 1-3.  I plan to address #4, also, but
haven't done so yet.  These diffs are big enough that they should give
the PG development team something to think about in the meantime :-)
Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get
out what I have, which works (for the problems it tackles), now.

With these changes, we can set up and run PostgreSQL with scripts the
same way we can with apache or proftpd or mysql.

In summary, this patch makes the following enhancements:

1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
   and command line options -k --unix-socket to the relevant programs.
2. Adds a -h option to postmaster to set the hostname or IP address to
   listen on instead of the default INADDR_ANY.
3. Extends some library interfaces to support the above.
4. Fixes a few memory leaks in PQconnectdb().

The default behavior is unchanged from stock 7.0.2; if you don't use
any of these new features, they don't change the operation.

David J. MacKenzie
2000-11-13 15:18:15 +00:00
Vadim B. Mikheev b0299c5d37 Auto checkpoint creation. 2000-11-09 11:26:00 +00:00
Peter Eisentraut d1bfa6c72e Add runtime configuration options to control permission bits and group
owner of unix socket.
2000-11-01 21:14:03 +00:00
Bruce Momjian 3d45543698 Oops, back out my unintended changes. 2000-10-11 17:58:01 +00:00
Bruce Momjian 5e38665f8a Update make_mkid 2000-10-11 17:55:34 +00:00
Tatsuo Ishii 2af8b963f1 Add runtime configuration option "silent_mode".
This is equivalent to postmaster's -S option.
2000-10-08 09:25:38 +00:00
Peter Eisentraut ffd9aaa0a9 A bit of cleanup after SSL patch. Add it to config file, improve
documentation.
2000-09-06 19:54:52 +00:00
Peter Eisentraut 3ce5c6f4d8 Maybe "shared_buffers" is a slightly better name than "shmem_buffers" for -B. 2000-08-28 11:57:41 +00:00
Peter Eisentraut 996832caee Make the location of the Kerberos server key file run time configurable
(rather than compile time). For libpq, even when Kerberos support is
compiled in, the default user name should still fall back to geteuid()
if it can't be determined via the Kerberos system.

A couple of fixes for string type configuration parameters, now that there
is one.
2000-08-25 10:00:35 +00:00
Tom Lane 7090c3e858 Make debug_assertions default to ON, when compiled in at all, for
backwards compatibility with old behavior.
2000-08-11 18:31:10 +00:00
Thomas G. Lockhart be703cd9e8 Implement nested block comments in the backend and in psql.
Include updates for the comment.sql regression test.
Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel.
Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT
 and SET AutoCommit in the parser only.
 Need to add code to actually do something.
Implement WITHOUT TIME ZONE type qualifier.
Define SCHEMA keyword, along with stubbed-out grammar.
Implement "[IN|INOUT|OUT] [varname] type" function arguments
 in parser only; INOUT and OUT throws an elog(ERROR).
Add PATH as a type-specific token, since PATH is in SQL99
 to support schema resource search and resolution.
2000-07-14 15:43:57 +00:00
Peter Eisentraut 648677c3a2 Add assert checking to GUC ("debug_assertions")
Rename settings net_server to tcpip_socket, max_backends to max_connections
Add --help and --version to postmaster, reformat help output
2000-07-12 17:38:53 +00:00