Commit Graph

1785 Commits

Author SHA1 Message Date
Tom Lane f3868f8af9 A bit of code beautification/cleanup of obsolete comments. Rethink
ordering of startup operations in one or two places.
2001-06-21 16:43:24 +00:00
Peter Eisentraut 9b4bfbdc2c Handle reading of startup packet and authentication exchange after forking
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.
2001-06-20 18:07:56 +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
Tom Lane 2917f0a5dd Tweak startup sequence so that running out of PROC array slots is
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.
2001-06-16 22:58:17 +00:00
Tom Lane 823ab92295 Add missing PG_SETMASK(&BlockSig) to SIGHUP_handler(). 2001-06-14 19:59:24 +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
Tom Lane 2a6f7ac456 Move temporary files into 'pg_tempfiles' subdirectory of each database
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.
2001-06-11 04:12:29 +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 12c1552066 Mark many strings in backend not covered by elog for translation. Also,
make strings in xlog.c look more like English and less like binary noise.
2001-06-03 14:53:56 +00:00
Bruce Momjian 33f2614aa1 Remove SEP_CHAR, replace with / or '/' as appropriate. 2001-05-30 14:15:27 +00:00
Bruce Momjian f6923ff3ac Oops, only wanted python change in the last commit. Backing out. 2001-05-25 15:45:34 +00:00
Bruce Momjian dffb673692 While changing Cygwin Python to build its core as a DLL (like Win32
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
2001-05-25 15:34:50 +00:00
Peter Eisentraut 47324d7689 Add extern int optreset declaration, per bug report from <info@decc.nl>. 2001-04-19 19:09:23 +00:00
Bruce Momjian 9e1552607a pgindent run. Make it all clean. 2001-03-22 04:01:46 +00:00
Tom Lane 5dd04603b9 Don't go belly-up if fork() fails for a routine checkpoint subprocess.
Just try again later.
2001-03-14 17:58:46 +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 d18c1d1f51 Truncate incoming username and database name to NAMEDATALEN-1 characters
so that we don't reject overlength names unnecessarily.
2001-02-20 01:34:40 +00:00
Tom Lane 68590993ea Improve error message when startup or shutdown proc fails. 2001-02-11 23:12:28 +00:00
Tom Lane d08741eab5 Restructure the key include files per recent pghackers discussion: there
are now separate files "postgres.h" and "postgres_fe.h", which are meant
to be the primary include files for backend .c files and frontend .c files
respectively.  By default, only include files meant for frontend use are
installed into the installation include directory.  There is a new make
target 'make install-all-headers' that adds the whole content of the
src/include tree to the installed fileset, for use by people who want to
develop server-side code without keeping the complete source tree on hand.
Cleaned up a whole lot of crufty and inconsistent header inclusions.
2001-02-10 02:31:31 +00:00
Tom Lane 897a895d32 When launching a child backend, take care to close file descriptors for
any other client connections that may exist (which would only happen if
another client is currently in the authentication cycle).  This avoids
wastage of open descriptors in a child.  It might also explain peculiar
behaviors like not closing connections when expected, since the kernel
will probably not signal EOF as long as some other backend is randomly
holding open a reference to the connection, even if the client went away
long since ...
2001-02-08 00:35:10 +00:00
Tom Lane 1dc3051088 Re-read Unix-socket lock file every so often (every CheckPoint interval,
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 ...
2001-01-27 00:05:31 +00:00
Bruce Momjian 623bf843d2 Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group. 2001-01-24 19:43:33 +00:00
Vadim B. Mikheev 7ceeeb662f New WAL version - CRC and data blocks backup. 2000-12-28 13:00:29 +00:00
Tom Lane 39b547f430 Prevent freshly-started backend from ignoring SIGUSR1, per race condition
observed by Inoue.  Also, don't call ProcRemove() from postmaster if we
have detected a backend crash --- too risky if shared memory is corrupted.
It's not needed anyway, considering we are going to reinitialize shared
memory and semaphores as soon as the last child is dead.
2000-12-20 21:51:52 +00:00
Bruce Momjian 1f159e562b >> Here is a patch for the beos port (All regression tests are OK).
>>     xlog.c : special case for beos to avoid 'link' which does not work yet
>>     beos/sem.c : implementation of new sem_ctl call (GETPID) and a new
>sem_op
>> flag (IPCNOWAIT)
>>     dynloader/beos.c : add a verification of symbol validity (seem that
the
>> loader sometime return OK with an invalid symbol)
>>     postmaster.c :  add beos forking support for the new checkpoint
process
>>     postgres.c : remove beos special case for getrusage
>>     beos.h : Correction of a bas definition of AF_UNIX, misc defnitions
>>
>>
>>     thanks
>>
>>
>>             cyril

Cyril VELTER
2000-12-18 18:45:05 +00:00
Tom Lane 5491233f52 Ensure that 'errno' is saved and restored by all signal handlers that
might change it.  Experimentation shows that the signal handler call
mechanism does not save/restore errno for you, at least not on Linux
or HPUX, so this is definitely a real risk.
2000-12-18 17:33:42 +00:00
Tom Lane a27b691e29 Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not.  This is necessary
for portability.  Per discussion on pghackers around 9/16/00.
2000-12-03 20:45:40 +00:00
Tom Lane b7c3784417 Repair residual sillinesses from UUNET virtual host/socket path patch.
I hope all the dust has settled out now ...
2000-11-30 23:20:51 +00:00
Tom Lane 3c0f3c9a7e Just noticed that with -S switch, MyProcPid is permanently wrong in
postmaster, because it isn't updated after forking away from the terminal.
Apparently it's not used anyplace in the postmaster ... but seems best
to make it show the correct PID ...
2000-11-29 22:04:04 +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
Tom Lane c715fdea26 Significant cleanups in SysV IPC handling (shared mem and semaphores).
IPC key assignment will now work correctly even when multiple postmasters
are using same logical port number (which is possible given -k switch).
There is only one shared-mem segment per postmaster now, not 3.
Rip out broken code for non-TAS case in bufmgr and xlog, substitute a
complete S_LOCK emulation using semaphores in spin.c.  TAS and non-TAS
logic is now exactly the same.
When deadlock is detected, "Deadlock detected" is now the elog(ERROR)
message, rather than a NOTICE that comes out before an unhelpful ERROR.
2000-11-28 23:27:57 +00:00
Hiroshi Inoue 9ee598e0ee Not invoke CheckPoint process while postmaster is waiting for all backends
to die.
2000-11-27 04:03:20 +00:00
Tom Lane bbea3643a3 Store current LC_COLLATE and LC_CTYPE settings in pg_control during initdb;
re-adopt these settings at every postmaster or standalone-backend startup.
This should fix problems with indexes becoming corrupt due to failure to
provide consistent locale environment for postmaster at all times.  Also,
refuse to start up a non-locale-enabled compilation in a database originally
initdb'd with a non-C locale.  Suppress LIKE index optimization if locale
is not "C" or "POSIX" (are there any other locales where it's safe?).
Issue NOTICE during initdb if selected locale disables LIKE optimization.
2000-11-25 20:33:54 +00:00
Peter Eisentraut fc6603ff75 Advertise --help (rather than '-?') as help option (problems with csh).
Accept --help even if no general long options support exists.
2000-11-25 19:05:44 +00:00
Bruce Momjian 9d5098ca78 Rename GUC name from unixsocket to unix_socket_directory 2000-11-25 04:13:18 +00:00
Peter Eisentraut a70e74b060 Put external declarations into header files. 2000-11-21 21:16:06 +00:00
Peter Eisentraut 76920de895 Rename parameter "hostname" to "virtual_host". Seemed very ambiguous... 2000-11-15 18:36:06 +00:00
Tom Lane 2cf48ca04b Extend CREATE DATABASE to allow selection of a template database to be
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-11-14 18:37:49 +00:00
Peter Eisentraut 8a9315ca92 Update and polish postmaster and postgres help output and man pages. 2000-11-14 18:11:32 +00:00
Bruce Momjian 026643a6e7 Rename PortName to PortNumber. 2000-11-14 01:15:06 +00:00
Bruce Momjian ebd61ac03f Remove -k unix socketpath option from client side, allow hostname with
leading slash to behave as a unix socket path.
2000-11-13 23:37:54 +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
Tom Lane ebb0a20149 Keep track of the last active slot in the shared ProcState array, so
that search loops only have to scan that far and not through all maxBackends
entries.  This eliminates a performance penalty for setting maxBackends
much higher than the average number of active backends.  Also, eliminate
no-longer-used 'backend tag' concept.  Remove setting of environment
variables at backend start (except for CYR_RECODE), since none of them
are being examined by the backend any longer.
2000-11-12 20:51:52 +00:00
Vadim B. Mikheev b0299c5d37 Auto checkpoint creation. 2000-11-09 11:26:00 +00:00
Peter Eisentraut 929a599369 Add '-c name=val' flag for setting run-time parameters. 2000-11-08 17:57:46 +00:00
Peter Eisentraut 306c44eead Add -V option to backend, to show version, since --version doesn't seem
to work everywhere.  Also, on FreeBSD you need to set the optreset variable
to 1 before parsing the command line a second time with getopt().
2000-11-06 22:18:10 +00:00
Peter Eisentraut abfb417574 Make the backend grok relative paths for the data directory by converting
it to an absolute path.
2000-11-04 12:43:24 +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 88094f2e2b beos fixes from Cyril VELTER 2000-10-28 18:27:57 +00:00
Tom Lane 6afa2ae4d2 Clean up broken test for whether to wait for input in SSL case.
Per discussion with Magnus Hagander.
2000-10-25 22:27:25 +00:00
Tom Lane 612f1b01f8 Check for SIGHUP and process config file updates just after waiting
for input, not just before.
2000-10-24 21:33:52 +00:00
Vadim B. Mikheev a7fcadd10a WAL 2000-10-21 15:43:36 +00:00
Vadim B. Mikheev 2c7de17b07 New file naming. Database OID is used as "tablespace" id and
relation OID is used as file node on creation but may be changed later
if required. Regression Tests Approved (c) -:)))
2000-10-16 14:52:28 +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
Bruce Momjian 87c0e623ba New diff that now covers the entire tree. Applying this gets postgresql
working on the VERY latest version of BeOS.  I'm sure there will be
alot of comments, but then if there weren't I'd be disappointed!

Thanks for your continuing efforts to get this into your tree.

Haven't bothered with the new files as they haven't changed.

BTW Peter, the compiler is "broken" about the bool define and so on.
I'm filing a bug report to try and get it addressed.  Hopefully then we
can tidy up the code a bit.

I await the replies with interest :)

David Reid
2000-10-03 03:11:26 +00:00
Peter Eisentraut 416bbbffa3 Banish caddr_t (mostly), use Datum where appropriate. 2000-10-02 19:42:56 +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 6dc249610a Code cleanup of user name and user id handling in the backend. The current
user is now defined in terms of the user id, the user name is only computed
upon request (for display purposes). This is kind of the opposite of the
previous state, which would maintain the user name and compute the user id
for permission checks.

Besides perhaps saving a few cycles (integer vs string), this now creates a
single point of attack for changing the user id during a connection, for
purposes of "setuid" functions, etc.
2000-09-06 14:15:31 +00:00
Peter Eisentraut 424f0edcb8 Fix relative path references so that make knowns which dependencies refer
to one another. Sort out builddir vs srcdir variable namings. Remove some
now obsoleted make variables.
2000-08-31 16:12:35 +00:00
Bruce Momjian 7bc654bb16 SSL patch from Magnus 2000-08-30 14:54:24 +00:00
Tom Lane 883d1cc1cc Include kernel error message in failed-to-open file reports. 2000-08-29 16:40:19 +00:00
Peter Eisentraut ef6164de1d Revert removal of signed, volatile, and signal handler arg type tests. 2000-08-29 09:36:51 +00:00
Peter Eisentraut 79abd73eee Remove configure tests for `signed', `volatile', and signal handler args;
the harm potential outweighs the possible benefits.
2000-08-27 19:00:41 +00:00
Peter Eisentraut 9b3d66ecbd Introduce HAVE_UNIX_SOCKETS symbol to replace repeatedly listing all the
unsupported platforms.
2000-08-20 10:55:35 +00:00
Tom Lane 9426047021 Clean up bogosities in use of random(3) and srandom(3) --- do not assume
that RAND_MAX applies to them, since it doesn't.  Instead add a
config.h parameter MAX_RANDOM_VALUE.  This is currently set at 2^31-1
but could be auto-configured if that ever proves necessary.  Also fix
some outright bugs like calling srand() where srandom() is appropriate.
2000-08-07 00:51:42 +00:00
Tom Lane 87cdaf5491 Remove <values.h> inclusions, no-longer-needed MAXINT definitions. 2000-07-28 02:13:52 +00:00
Tom Lane bec98a31c5 Revise aggregate functions per earlier discussions in pghackers.
There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...
2000-07-17 03:05:41 +00:00
Peter Eisentraut cb292206c5 Remove a bunch of unused configure tests, in particular cases where
* the result is not recorded anywhere
* the result is not used anywhere
* the result is only used in some places, whereas others have been getting away with it
* the result is used improperly

Also make command line options handling a little better (e.g., --disable-locale,
while redundant, should really still *dis*able).
2000-07-12 22:59:15 +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
Peter Eisentraut 74618e2b82 Another round of those unportable config/build changes :-/
* Add option to build with OpenSSL out of the box. Fix thusly exposed
  bit rot. Although it compiles now, getting this to do something
  useful is left as an exercise.

* Fix Kerberos options to defer checking for required libraries until
  all the other libraries are checked for.

* Change default odbcinst.ini and krb5.srvtab path to PREFIX/etc.

* Install work around for Autoconf's install-sh relative path anomaly.
  Get rid of old INSTL_*_OPTS variables, now that we don't need them
  anymore.

* Use `gunzip -c' instead of g?zcat. Reportedly broke on AIX.

* Look for only one of readline.h or readline/readline.h, not both.

* Make check for PS_STRINGS cacheable. Don't test for the header files
  separately.

* Disable fcntl(F_SETLK) test on Linux.

* Substitute the standard GCC warnings set into CFLAGS in configure,
  don't add it on in Makefile.global.

* Sweep through contrib tree to teach makefiles standard semantics.

... and in completely unrelated news:

* Make postmaster.opts arbitrary options-aware. I still think we need to
  save the environment as well.
2000-07-09 13:14:19 +00:00
Tom Lane ba62fe32c3 Remove long-dead support for invoking queries from dynamically loaded
backend functions via backend PQexec().  The SPI interface has long
been our only documented way to do this, and the backend pqexec/portal
code is unused and suffering bit-rot.  I'm putting it out of its misery.
2000-07-08 03:04:41 +00:00
Peter Eisentraut e2d3932e0e Move PGPORT envar handling to ResetAllOptions(). Improve long options
parsing to not clobber the optarg string -- so that we can bring
SetOptsFile() up to speed.
2000-07-03 20:46:10 +00:00
Peter Eisentraut 6fb9d2e347 Version number now set in configure, available through Makefile.global
and config.h. Adjusted all referring code.

Scrapped pg_version and changed initdb accordingly. Integrated
src/utils/version.c into src/backend/utils/init/miscinit.c. Changed all
callers.

Set version number to `7.1devel'. (Non-numeric version suffixes now allowed.)
2000-07-02 15:21:27 +00:00
Tom Lane 1aebc3618a First phase of memory management rewrite (see backend/utils/mmgr/README
for details).  It doesn't really do that much yet, since there are no
short-term memory contexts in the executor, but the infrastructure is
in place and long-term contexts are handled reasonably.  A few long-
standing bugs have been fixed, such as 'VACUUM; anything' in a single
query string crashing.  Also, out-of-memory is now considered a
recoverable ERROR, not FATAL.
Eliminate a large amount of crufty, now-dead code in and around
memory management.
Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and
backend startup.
2000-06-28 03:33:33 +00:00
Peter Eisentraut c446509565 Second pass over run-time configuration system. Adjust priorities on some
option settings. Sort out SIGHUP vs BACKEND -- there is no total ordering
here, so make explicit checks. Add comments explaining all of this.
Removed permissions check on SHOW command.

Add examine_subclass to the game, rename to SQL_inheritance to fit the
official data model better. Adjust documentation.

Standalone backend needs to reset all options before it starts. To
facilitate that, have IsUnderPostmaster be set by the postmaster itself,
don't wait for the magic -p switch.

Also make sure that all environment variables and argv's survive
init_ps_display(). Use strdup where necessary.

Have initdb make configuration files (postgresql.conf, pg_hba.conf) mode
0600 -- having configuration files is no fun if you can't edit them.
2000-06-22 22:31:24 +00:00
Peter Eisentraut 44d1abebb4 Big warnings cleanup for Solaris/GCC. Down to about 40 now, but
we'll get there one day.

Use `cat' to create aclocal.m4, not `aclocal'. Some people don't
have automake installed.

Only run the autoconf rule in the top-level GNUmakefile if the
invoker specified `make configure', don't run it automatically
because of CVS timestamp skew.
2000-06-14 18:18:01 +00:00
Peter Eisentraut 4032a515d2 PGPORT envar was erroneously ignored by the backend 2000-06-06 16:04:32 +00:00
Peter Eisentraut 209aa77d98 New ps display code, works on more platforms.
Install a default configuration file.

Clean up some funny business in the config file code.
2000-06-04 01:44:38 +00:00
Bruce Momjian cc2b5e5815 Remove NT-specific file open defines by defining our own open macros for
"rb" and "wb".
2000-06-02 15:57:44 +00:00
Peter Eisentraut 6a68f42648 The heralded `Grand Unified Configuration scheme' (GUC)
That means you can now set your options in either or all of $PGDATA/configuration,
some postmaster option (--enable-fsync=off), or set a SET command. The list of
options is in backend/utils/misc/guc.c, documentation will be written post haste.

pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
-Q, and -T options (no longer applicable, although -d0 does the same as -Q).

Added to configure an --enable-syslog option.

changed all callers from TPRINTF to elog(DEBUG)
2000-05-31 00:28:42 +00:00
Tom Lane 091126fa28 Generated header files parse.h and fmgroids.h are now copied into
the src/include tree, so that -I backend is no longer necessary anywhere.
Also, clean up some bit rot in contrib tree.
2000-05-29 05:45:56 +00:00
Tom Lane d4e27596cf More paranoia about global variables containing references to long-
since-closed file descriptors...
2000-05-26 01:38:08 +00:00
Bruce Momjian a267c88d3b Make setproctitle update for every query. 2000-05-24 00:14:26 +00:00
Bruce Momjian d264fb4157 comment cleanup 2000-05-23 22:16:27 +00:00
Tom Lane 85a5303877 -D switch to postmaster should override any PGDATA environment variable
that might be hanging about.  Now it does ... amazing nobody noticed
this before ...
2000-04-27 02:59:17 +00:00
Bruce Momjian 52f77df613 Ye-old pgindent run. Same 4-space tabs. 2000-04-12 17:17:23 +00:00
Tom Lane 58422dd0af Several calls to StrNCpy incorrectly subtracted 1 from the length arg,
leading to postmaster accepting args 1 shorter than it had room for.
2000-03-19 22:10:08 +00:00
Tom Lane 341b328b18 Fix a bunch of minor portability problems and maybe-bugs revealed by
running gcc and HP's cc with warnings cranked way up.  Signed vs unsigned
comparisons, routines declared static and then defined not-static,
that kind of thing.  Tedious, but perhaps useful...
2000-03-17 02:36:41 +00:00
Hiroshi Inoue e3a97b370c Implement reindex command 2000-02-18 09:30:20 +00:00
Bruce Momjian 5c25d60244 Add:
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.
2000-01-26 05:58:53 +00:00
Tom Lane d242b64ba2 Tweak includes to avoid compiler warning on HPUX. 2000-01-20 04:11:52 +00:00
Tatsuo Ishii 3f3421f905 Move SetPidFile() and firends to utils/init/miscinit.c so that
tcop/postgres.c can use them. Now we have an interlock between
postmaster and postgres.
2000-01-09 12:13:24 +00:00
Tatsuo Ishii 27fdbca749 Correct grammatical error 2000-01-07 09:28:03 +00:00
Bruce Momjian 7585deb087 I have done the QNX4 port with the current source tree. The number of
backend/Makefiles to be patched could significantly be reduced since
they
have been adopted to the QNX4 needs.

Andreas Kardos
1999-12-16 01:25:23 +00:00
Bruce Momjian a82f9ffde6 New LDOUT makefile variable for QNX os. 1999-12-13 22:35:27 +00:00
Bruce Momjian 3ffd3d82db Make LD -r as macros that can be changed for QNX. 1999-12-09 19:15:45 +00:00
Tatsuo Ishii 169051afc9 Fix bugs regarding pid file. 1999-12-06 07:21:12 +00:00
Tatsuo Ishii d9f61cfa15 Unlink the pid file if it's bogus (no associated process exists) 1999-12-04 08:23:43 +00:00
Tatsuo Ishii dde36bfb7c Create postmaster.pid and postmaster.opts under $PGDATA 1999-12-03 06:26:34 +00:00
Tom Lane 51f62d505e Standardize on MAXPGPATH as the size of a file pathname buffer,
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-10-25 03:08:03 +00:00
Bruce Momjian 7395d9ab4e Update display of debug levels. 1999-10-08 05:36:58 +00:00
Bruce Momjian b3c7ad5750 Comment cleanup. 1999-10-08 05:20:48 +00:00
Bruce Momjian ae61ef34bd Cleanup -is flag to -l for SSL. Another PERL variable name fix. Clean
up debugging options for postmaster and postgres programs.  postmaster
-d is no longer optional.  Documentation updates.
1999-10-08 04:28:57 +00:00
Vadim B. Mikheev c528c42ec2 More startup/shutdown log messages. 1999-10-08 02:16:22 +00:00
Vadim B. Mikheev 4040fcfa78 Small cleanup. 1999-10-06 22:44:25 +00:00
Vadim B. Mikheev 4793740367 XLOG (also known as WAL -:)) Bootstrap/Startup/Shutdown.
First step in cleaning up backend initialization code.
Fix for FATAL: now FATAL is ERROR + exit.
1999-10-06 21:58:18 +00:00
Tom Lane 2993f0c100 Reverse out getopt patch --- turns out it doesn't help on my
platform, and there are at least some people it's not broken for.  So undo
change until we can discuss a more portable solution.
1999-09-30 02:45:17 +00:00
Tom Lane 1764d9579e Un-break optarg() call --- some peoples' optarg libraries
don't like extraneous colons in the option list...
1999-09-30 02:17:23 +00:00
Vadim B. Mikheev 30659d43eb Transaction log manager core code.
It doesn't work currently but also don't break anything -:)
1999-09-27 15:48:12 +00:00
Bruce Momjian e0e7daef6d Lots of patches coming in from me today :-)
When drawing up a very simple "text-drawing" of how the negotiation is done,
I realised I had done this last part (fallback) in a very stupid way. Patch
#4 fixes this, and does it in a much better way.

Included is also the simple text-drawing of how the negotiation is done.

//Magnus
1999-09-27 03:13:16 +00:00
Bruce Momjian ad604ac372 values.h patch from Alex Howansky 1999-09-21 20:58:25 +00:00
Bruce Momjian e44c931801 Re-add getopt.h check, remove NT-specific tests for it. 1999-07-19 02:27:16 +00:00
Bruce Momjian 3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
Bruce Momjian 7d5b08dec0 More cleanup 1999-07-16 05:41:19 +00:00
Bruce Momjian a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
Bruce Momjian 9b645d481c Update #include cleanups 1999-07-16 03:14:30 +00:00
Bruce Momjian a9591ce66a Change #include's to use <> and "" as appropriate. 1999-07-15 23:04:24 +00:00
Bruce Momjian 4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
Bruce Momjian 38ff52c379 Allow port numbers 32k - 64k. 1999-07-07 17:17:50 +00:00
Bruce Momjian 954e466c27 Fix for removal of temp tables if last transaction was aborted. 1999-07-02 18:09:28 +00:00
Tom Lane 8f19603d6c Add startup-time check that -B is not unreasonably small for
given number of backends (-N), per recent discussion in pghackers list.
1999-06-04 21:14:46 +00:00
Bruce Momjian 07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
Tom Lane cf1478982c Modify backend switch parsing to prevent 'insecure' switches
from being accepted when they are passed from client connection request.
Get rid of a couple that no longer do anything (like -P).
1999-05-22 17:47:54 +00:00
Tom Lane 9d197856dd Rearrange handling of MAXBACKENDS a little bit. The default setting
of MAXBACKENDS is now 1024, since all it's costing is about 32 bytes of memory
per array slot.  configure's --with-maxbackends switch now controls DEF_MAXBACKENDS
which is simply the default value of the postmaster's -N switch.  Thus,
the out-of-the-box configuration will still limit you to 64 backends,
but you can go up to 1024 backends simply by restarting the postmaster with
a different -N switch --- no rebuild required.
1999-02-21 01:41:55 +00:00
Tom Lane e77b630cf0 Allow maximum number of backends to be set at configure time
(--with-maxbackends).  Add a postmaster switch (-N backends) that allows
the limit to be reduced at postmaster start time.  (You can't increase it,
sorry to say, because there are still some fixed-size arrays.)
Grab the number of semaphores indicated by min(MAXBACKENDS, -N) at
postmaster startup, so that this particular form of bogus configuration
is exposed immediately rather than under heavy load.
1999-02-19 06:06:39 +00:00
Bruce Momjian 6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
Tom Lane 36c1895533 Fix postmaster to not try to start more than MaxBackendId children,
per patch from Tatsuo Ishii
1999-01-30 20:04:37 +00:00
Bruce Momjian 7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
Tom Lane 79fcde48b2 Portability fix for old SunOS releases: fflush(NULL)
doesn't work there.  Fortunately the postmaster only has stdout and
stderr to flush.
1998-11-29 01:51:56 +00:00
Bruce Momjian fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
Bruce Momjian af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
Marc G. Fournier 7414d61950 From: Massimo Dal Zotto <dz@cs.unitn.it>
> tprintf.patch
>
>       tprintf.patch
>
>       adds functions and macros which implement a conditional trace package
>       with the ability to change flags and numeric options of running
>       backends at runtime.
>       Options/flags can be specified in the command line and/or read from
>       the file pg_options in the data directory.
1998-08-25 21:34:10 +00:00
Marc G. Fournier 1a5fb65463 From: Massimo Dal Zotto <dz@cs.unitn.it>
assert.patch

        adds a switch to turn on/off the assert checking if enabled at compile
        time. You can now compile postgres with assert checking and disable it
        at runtime in a production environment.
1998-08-25 21:04:41 +00:00
Marc G. Fournier a0659e3e2c From: Tom Lane <tgl@sss.pgh.pa.us>
Making PQrequestCancel safe to call in a signal handler turned out to be
much easier than I feared.  So here are the diffs.

Some notes:
  * I modified the postmaster's packet "iodone" callback interface to allow
    the callback routine to return a continue-or-drop-connection return
    code; this was necessary to allow the connection to be closed after
    receiving a Cancel, rather than proceeding to launch a new backend...
    Being a neatnik, I also made the iodone proc have a typechecked
    parameter list.
  * I deleted all code I could find that had to do with OOB.
  * I made some edits to ensure that all signals mentioned in the code
    are referred to symbolically not by numbers ("SIGUSR2" not "2").
    I think Bruce may have already done at least some of the same edits;
    I hope that merging these patches is not too painful.
1998-07-09 03:29:11 +00:00
Bruce Momjian 7487a82667 More cleanups for compiler warnings. 1998-06-27 14:06:41 +00:00
Bruce Momjian 48a94aaf51 Rename proc_exit_clear to on_exit_reset. 1998-06-27 13:24:21 +00:00
Bruce Momjian e747c58718 Fix for hang after postmaster restart. Add new proc_exit and
shmem_exit to replace exitpg().
1998-06-27 04:53:49 +00:00
Bruce Momjian 94cc3abe60 Cleanups. 1998-06-18 03:44:00 +00:00
Bruce Momjian 6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
Bruce Momjian 19a95d9742 Fix for exec() removal. 1998-06-09 17:36:28 +00:00
Bruce Momjian a608637768 Another for for exec() removal and finding binaries. 1998-06-09 17:13:06 +00:00
Bruce Momjian cb8539f9be Attached is a patch that fixes these leaks, and does a couple other
things as well:
  * Computes and saves a cancel key for each backend.  * fflush
  before forking, to eliminate double-buffering problems
    between postmaster and backends.

Other cleanups.

Tom Lane
1998-06-09 04:06:12 +00:00
Bruce Momjian 3912b75705 Fixed exec path problem. 1998-06-08 22:28:30 +00:00
Bruce Momjian 0957e08ac3 Show filename on exec failure. 1998-06-08 19:36:40 +00:00
Bruce Momjian 1572800b16 Fix typo. 1998-06-08 19:15:05 +00:00
Bruce Momjian 556e603b25 Add real random() call to postmaster for use in cancel. 1998-06-08 04:27:59 +00:00
Bruce Momjian a576a60e3f Show backend status on ps command line. Remove unused args from
pg_exec_query().
1998-06-04 17:26:49 +00:00
Bruce Momjian ff84c98a65 cleanup. 1998-05-29 17:10:07 +00:00
Bruce Momjian 212c905e2c Remove fork()/exec() and only do fork(). Small cleanups. 1998-05-29 17:00:34 +00:00
Bruce Momjian 3af1cc6755 postmaster/postgres options cleanup. 1998-05-27 18:32:05 +00:00
Bruce Momjian 1e801a8f16 Hi,
Attached you'll find a (big) patch that fixes make dep and make
depend in all Makefiles where I found it to be appropriate.

It also removes the dependency in Makefile.global for NAMEDATALEN
and OIDNAMELEN by making backend/catalog/genbki.sh and bin/initdb/initdb.sh
a little smarter.

This no longer requires initdb.sh that is turned into initdb with
a sed script when installing Postgres, hence initdb.sh should be
renamed to initdb (after the patch has been applied :-) )

This patch is against the 6.3 sources, as it took a while to
complete.

Please review and apply,

Cheers,

Jeroen van Vianen
1998-04-06 00:32:26 +00:00
Bruce Momjian 9a0dd4fb18 There's a patch attached to fix gcc 2.8.x warnings, except for the
yyerror ones from bison. It also includes a few 'enhancements' to
the C programming style (which are, of course, personal).

The other patch removes the compilation of backend/lib/qsort.c, as
qsort() is a standard function in stdlib.h and can be used any
where else (and it is). It was only used in
backend/optimizer/geqo/geqo_pool.c, backend/optimizer/path/predmig.c,
and backend/storage/page/bufpage.c

> > Some or all of these changes might not be appropriate for v6.3,
since we > > are in beta testing and since they do not affect the
current functionality.  > > For those cases, how about submitting
patches based on the final v6.3 > > release?

There's more to come. Please review these patches. I ran the
regression tests and they only failed where this was expected
(random, geo, etc).

Cheers,

Jeroen
1998-03-30 16:47:35 +00:00
Bruce Momjian a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
Marc G. Fournier 0227a4e114 From: "Denis V. Dmitrienko" <denis@null.net>
What it does:
It solves stupid problem with cyrillic charsets IP-based on-fly recoding.
take a look at /data/charset.conf for details.
You can use any tables for any charset.
Tables are from Russian Apache project.
Tables in this patch contains also Ukrainian characters.

Then run ./configure --enable-recode
1998-02-24 15:27:04 +00:00
Marc G. Fournier 93211b9170 From: Phil Thompson <phil@river-bank.demon.co.uk>
I haven't had final confirmation from Peter yet, but the attached patch
needs to be applied for the Beta otherwise password and crypt
authentication just won't work.

It puts back the loop in libpq and also fixes a couple of problems with
maintaining compatability with pre-6.3 drivers.
1998-01-31 20:14:15 +00:00
Bruce Momjian b4564a98fa Deadlock ceallnup.
(void) change for aix and hp compilers.

protocol cleanup.
1998-01-27 15:35:30 +00:00
Bruce Momjian 7c3dc8f772 Protocol cleanup from Phil. 1998-01-27 03:11:46 +00:00
Marc G. Fournier d5bbe2aca5 From: Phil Thompson <phil@river-bank.demon.co.uk>
I've completed the patch to fix the protocol and authentication issues I
was discussing a couple of weeks ago.  The particular changes are:

- the protocol has a version number
- network byte order is used throughout
- the pg_hba.conf file is used to specify what method is used to
  authenticate a frontend (either password, ident, trust, reject, krb4
  or krb5)
- support for multiplexed backends is removed
- appropriate changes to man pages
- the -a switch to many programs to specify an authentication service
  no longer has any effect
- the libpq.so version number has changed to 1.1

The new backend still supports the old protocol so old interfaces won't
break.
1998-01-26 01:42:53 +00:00
Bruce Momjian c16ebb0f67 getpid/pid cleanup 1998-01-25 05:15:15 +00:00
Marc G. Fournier 6e337eef45 Major cleanout of PORTNAME variables from Makefiles...bound to screw up
some of the ports...
1997-12-20 00:29:35 +00:00
Marc G. Fournier 5379b84eff More cleanups. I can now compile without PORTNAME being defined n
Makefile.global.

End result, if all goes well, should allow for much easier porting, since
there will no longer be a concept of a "port".  Most, if not everything,
*should* be determined by configure, or by the compiler itself.  Still
work to be done though :)
1997-12-19 02:09:10 +00:00
Bruce Momjian 0f1802f00c Fix for user password packet processing, from Goran Thyni. 1997-12-15 22:03:59 +00:00
Bruce Momjian 645cc13276 Remove PGDATA setting and use DataDir. 1997-12-11 17:03:52 +00:00
Marc G. Fournier da72b903ff Major code cleanup following the pg_password insertion...
...malloc/free -> palloc/pfree
	...fopen/fclose -> AllocateFile/FreeFile
1997-12-09 03:11:25 +00:00
Marc G. Fournier bec35da8bf Add error check on getenv("DATADIR")
Add code to set DATADIR in postmaster.c if -D is used
1997-12-07 20:57:45 +00:00
Marc G. Fournier 4c04f7724e From: todd brandys <brandys@eng3.hep.uiuc.edu>
An extension to the code to allow for a pg_password authentication database
that is *seperate* from the system password file
1997-12-04 00:28:15 +00:00
Marc G. Fournier 9bcf350cc7 Apply Bryan's IPC Patches
From: Bryan Henderson <bryanh@giraffe.netgate.net>
1997-11-17 03:47:31 +00:00
Bruce Momjian baeb8790ac Fix case issues with quotes. 1997-11-10 05:10:50 +00:00
Bruce Momjian c17fa36d3c Add Unix domain socket support, from Goran Thyni, goran@bildbasen.se 1997-11-07 20:52:15 +00:00
Bruce Momjian f3af1368bd Rename strNcpy to StrNCpy, and change third parameter. 1997-10-25 01:10:58 +00:00
Bruce Momjian 3f365ba0fc Inline memset() as MemSet(). 1997-09-18 20:22:58 +00:00
Bruce Momjian 59f6a57e59 Used modified version of indent that understands over 100 typedefs. 1997-09-08 21:56:23 +00:00
Bruce Momjian 075cede748 Add typdefs to pgindent run. 1997-09-08 20:59:27 +00:00
Bruce Momjian 319dbfa736 Another PGINDENT run that changes variable indenting and case label indenting. Also static variable indenting. 1997-09-08 02:41:22 +00:00
Bruce Momjian 1ccd423235 Massive commit to run PGINDENT on all *.c and *.h files. 1997-09-07 05:04:48 +00:00
Bruce Momjian 8d0e658d06 Small cleanup. 1997-08-25 04:15:40 +00:00
Bruce Momjian 1d8bbfd2e7 Make functions static where possible, enclose unused functions in #ifdef NOT_USED. 1997-08-19 21:40:56 +00:00
Bruce Momjian ea5b5357cd Remove more (void) and fix -Wall warnings. 1997-08-12 22:55:25 +00:00
Bruce Momjian edb58721b8 Fix pgproc names over 15 chars in output. Add strNcpy() function. remove some (void) casts that are unnecessary. 1997-08-12 20:16:25 +00:00
Bruce Momjian 6ed1715b1f Cleanup for NAMEDATALEN use. 1997-08-03 02:38:47 +00:00
Marc G. Fournier ecefacd07d Due to BIND 8.1.1, my Solaris 2.5.1 machine doesn't define MAXHOSTNAMELEN...
so, add a check that basically says if it isn't defined, set it to 256...
1997-07-30 14:08:11 +00:00
Marc G. Fournier 5089f6ce87 Check for and use <netdb.h> for postmaster.c, instead of checking if
MAXHOSTNAMELEN is defined.  For some reason, my 2.5.1 Solaris box at
work fails on that check...
1997-07-30 14:03:33 +00:00
Marc G. Fournier ca746f512d -m <arg> -M weren't setup properly in getopts()...
These are undocumented in the man pages though...should they be removed?

Reported by: "A. Duursma" <it@portsite.nl>
1997-05-25 15:37:15 +00:00
Marc G. Fournier 79ee06c186 Fixes:
postgres backend processes end up as so called zombies. It seems that
only Linux a.out (libc.4.6.27) systems are affected.


By:

Wolfgang Roth <roth@statistik.uni-mannheim.de>
1997-04-24 20:27:46 +00:00
Marc G. Fournier 5b1311acfb From: Oleg Bartunov <oleg@sai.msu.su>
Subject: [HACKERS] locale patches !

Hi there,

here are little patches to get Postgres 6.1 works with locale stuff.
This is a patch against 970402.tar.gz, there are no problem to apply them
by hand to 6.0 release. Collate stuff tested about 1-2 months in real
working database but I'm sure there must be no problem. US hackers
could vote against locale implementation ( locale for sure will affect to
speed of postgres ), so I introduce variable USE_LOCALE which
controls locale stuff. Non-US users now could use ~* operator
for searching and <order by> for strings with nation alphabet.
Please, don't forget, as I did first time, to set environment variable
LC_CTYPE and LC_COLLATE because backend get locale information from them.
I start postmaster from a little script, assuming that shell is Bash shell
it looks like:

#!/bin/sh

export LC_CTYPE=koi8-r
export LC_COLLATE=koi8-r
postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
1997-04-02 18:13:47 +00:00
Marc G. Fournier 3a7c93e7f3 From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] password authentication

This patch adds support for plaintext password authentication.  To use
it, you add a line like

host         all         0.0.0.0       0.0.0.0           password  pg_pwd.conf


to your pg_hba.conf, where 'pg_pwd.conf' is the name of a file containing
the usernames and password hashes in the format of the first two fields
of a Unix /etc/passwd file.  (Of course, you can use a specific database
name or IP instead.)

Then, to connect with a password through libpq, you use the PQconnectdb()
function, specifying the "password=" tag in the connect string and also
adding the tag "authtype=password".

I also added a command-line switch '-u' to psql that tells it to prompt
for a username and password and use password authentication.
1997-03-12 21:23:16 +00:00
Bruce Momjian 26eb44f202 Prevent SIGPIPE from crashing server, by Dan McGuirk. 1997-03-02 02:17:32 +00:00
Bruce Momjian 34f35a4c19 Delete -e option to postmaster, keep postgres -e option. 1997-02-19 01:31:30 +00:00
Bruce Momjian a17b01f320 Update btree patches that were missed. 1997-02-18 17:14:25 +00:00
Bruce Momjian 31c8e94b34 Remove WIN32 defines. They never worked. 1997-02-14 04:19:07 +00:00
Marc G. Fournier a5494a2d92 Various patches for nextstep by GregorHoffleit
Replaced NEED_STRDUP by !HAVE_STRDUP
1997-02-13 08:32:20 +00:00
Bruce Momjian 89868af425 Remove extra paren in ifdef. 1997-02-06 19:27:22 +00:00
Marc G. Fournier a7257ff41f autoconf test for and set HAVE_VFORK 1997-02-06 06:15:49 +00:00
Marc G. Fournier 6ab9db7b78 Apply usage patches for European Dates patch from Keith 1997-01-27 22:37:52 +00:00
Marc G. Fournier 632c44d829 Bring in a patch from Keith Parks to move the use of European dates
from a #define to a run-time option '-e'

Man page was updated to reflect new option
1997-01-26 15:32:28 +00:00
Marc G. Fournier f12c5f898c Another switch for configure: NEED_SYS_SELECT_H to HAVE_SYS_SELECT_H 1997-01-24 18:27:32 +00:00
Marc G. Fournier 3ffd5694dd Replace occurances of USE_{LIMITS,VALUES}_H with HAVE_* in preparation
for switch over to configure
1997-01-24 18:00:48 +00:00
Marc G. Fournier c1392c57cf Another one that should be including limits.h vs machine/limits.h 1997-01-22 04:45:45 +00:00
Bryan Henderson 05b0f22900 Eliminate dupliclate definition of external variables reldesc and DataDir.
Some compilers recognize this error.
1997-01-14 08:05:36 +00:00
Bruce Momjian cb6cb7745d Here's the final set of patches to 6.0 (sup'd on 27/12/96) that allow a full
gmake of the code without interruption.

There's also some tidy-up of the MAXPATHLEN stuff based on the assumption that
all supported platforms have MAXPATHLEN defined in <sys/param.h>.

(The only unknowns for the above are AIX and IRIX5.)
1996-12-28 02:13:05 +00:00
Bruce Momjian e8f43854ac pq/signal() portability patch. Also psql copy prompt fix. 1996-12-26 22:08:34 +00:00
Bruce Momjian 0681513693 In file: .../src/backend/postmaster/postmaster.c I found 3 leaks and
probably a bug.
To find code added/modifyied, search "Fixed".

Gianluca Puggelli
1996-12-26 17:49:05 +00:00
Bruce Momjian 2e20099e32 Reduce printing from deub level 2 ande layout change. 1996-12-07 04:38:40 +00:00
Bryan Henderson 9c0afeabb7 More stuff to make it compile on various ports. 1996-11-27 08:16:44 +00:00
Bryan Henderson d3f9d6ad4f Move include of signal.h inside pqsignal.h so it's always where it's needed. 1996-11-24 04:07:17 +00:00
Bryan Henderson f64b840387 Remove most compile-time options, add a few runtime options to make up for it.
In particular, no more compiled-in default for PGDATA or LIBDIR.  Commands
that need them need either invocation options or environment variables.
PGPORT default is hardcoded as 5432, but overrideable with options or
environment variables.
1996-11-14 10:25:54 +00:00
Bryan Henderson 17befd6c69 Use new utils/version.c instead of backend/utils/init/magic.c. 1996-11-12 06:47:10 +00:00
Bruce Momjian aaeef4d17d All external function definitions now have prototypes that are checked. 1996-11-10 03:06:38 +00:00
Bryan Henderson bf5cbbf789 Quiet compiler warnings. 1996-11-10 02:27:15 +00:00
Bruce Momjian a0990e1884 Makefile cleanup after reorganization 1996-11-09 06:24:51 +00:00
Bruce Momjian 4b2b8592a0 Compile and warning cleanup 1996-11-08 06:02:30 +00:00
Marc G. Fournier daa93cf5c5 Clean up Makefile, make sure that postmaster.c compiles 1996-11-03 04:48:27 +00:00
Bryan Henderson 1dfe4eaeb1 Fix small syntax error. 1996-10-30 00:36:59 +00:00
Bryan Henderson 71c1d59d1a Remove another snprintf() for Solaris. 1996-10-29 21:51:13 +00:00
Bryan Henderson 63481f0b92 Use strncpy() and local buffers instead of snprintf(), since not everyone
has snprintf().
1996-10-28 09:05:29 +00:00
Bryan Henderson b0d6f0aa63 Simplify make files, add full dependencies. 1996-10-27 09:55:05 +00:00
Marc G. Fournier 20b4c46e26 Fixes: Errors when PQexec() in backend creates temp
relations and transaction is aborted

Submitted by: wieck@sapserv.debis.de (Jan Wieck)
1996-10-24 07:55:54 +00:00
Bruce Momjian baf9a6e24c Added include needed for recent addition.
I hope everyone has sys/socket.h.
1996-10-13 18:38:04 +00:00
Bruce Momjian 86be8677a9 Added consistent include file handling for MAXHOSTNAMELEN.
If I have introduced any syntax errors with this, I will patch them in
the morning, and Marc will have a good laugh.
1996-10-13 04:50:27 +00:00
Bryan Henderson bef3c89a1c Fix prototypes so postmaster.c will compile. 1996-10-13 04:01:05 +00:00
Bryan Henderson 785234d6ca New host-based authentication -- send error message when authentication fails 1996-10-12 07:48:49 +00:00
Marc G. Fournier 3dc0c8e4e5 Fixed a missed change from Carsten Heyl <heyl@nads.de> 1996-10-07 07:18:34 +00:00
Marc G. Fournier 4feb696be7 Here the fix for the first assertion failure I had which killed
my postmaster 1.07.
It's really simple, the loop dealing with all sockets
can't handle more than one ready socket :-)
A simple logic error dealing with lists.
OR IS THERE ANY REASON FOR SETTING curr TO 0?

Submitted by:  Carsten Heyl <Heyl@nads.de>
1996-10-04 20:32:07 +00:00
Marc G. Fournier f8009e1786 The remainder of D'Arcy's changes, most notibly the usage of SIGNAL_ARGS 1996-10-04 20:17:11 +00:00
Bruce Momjian deaaecdf2e Prevents possible packet loss from SIGCHLD. 1996-09-26 03:17:44 +00:00
Marc G. Fournier e3b41d40fa More code cleanups from "Kurt J. Lidl" <lidl@va.pubnix.com> 1996-09-16 05:40:31 +00:00
Marc G. Fournier c028568217 first pass...move some of the "Port" dependencies to src/include/config.h 1996-08-27 06:55:28 +00:00
Marc G. Fournier 80d0c4ffd3 The following patch makes postmaster -D work. -D specifies a different PGDATA
directory.  The code that looks for the pg_hba file doesn't use it, though,
so the postmaster uses the wrong pg_hba file.  Also, when the postmaster
looks in one directory and the user thinks it is looking in another
directory, the error messages don't give enough information to solve the
problem.  I extended the error message for this.


Submitted by: Bryan Henderson <bryanh@giraffe.netgate.net>
1996-08-14 04:51:34 +00:00
Marc G. Fournier bb0bdfd101 Fixes:
I've enclosed two patches.  The first affects Solaris compilability.  The
bug stems from netdb.h (where MAXHOSTNAMELEN is defined on a stock
system).  If the user has installed the header files from BIND 4.9.x,
there will be no definition of MAXHOSTNAMELEN.  The patch will, if all
else fails, try to include <arpa/nameser.h> and set MAXHOSTNAMELEN to
MAXDNAME, which is 256 (just like MAXHOSTNAMELEN on a stock system).

The second patch adds aliases for "ISNULL" to "IS NULL" and likewise for
"NOTNULL" to "IS NOT NULL".  I have not removed the postgres specific
ISNULL and NOTNULL.  I noticed this on the TODO list, and figured it would
be easy to remove.

The full semantics are:
        [ expression IS NULL ]
        [ expression IS NOT NULL ]

--Jason


Submitted by: Jason Wright <jason@oozoo.vnet.net>
1996-08-06 16:43:41 +00:00
Marc G. Fournier 7344d69898 Finished merging in src/backend from Dr. George's source tree 1996-07-23 02:23:54 +00:00
Marc G. Fournier 55aab6a434 fix: BSDi 2.1 requires a port seperate from BSDi 2.0{.1}
submitted by: Bruce Momjian (root@candle.pha.pa.us)
1996-07-16 07:13:58 +00:00
Marc G. Fournier d31084e9d1 Postgres95 1.01 Distribution - Virgin Sources 1996-07-09 06:22:35 +00:00