summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/misc.c
AgeCommit message (Collapse)Author
2007-08-19Provide for logfiles in machine readable CSV format. In consequence, renameAndrew Dunstan
redirect_stderr to logging_collector. Original patch from Arul Shaji, subsequently modified by Greg Smith, and then heavily modified by me.
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-11-21On systems that have setsid(2) (which should be just about everything exceptTom Lane
Windows), arrange for each postmaster child process to be its own process group leader, and deliver signals SIGINT, SIGTERM, SIGQUIT to the whole process group not only the direct child process. This provides saner behavior for archive and recovery scripts; in particular, it's possible to shut down a warm-standby recovery server using "pg_ctl stop -m immediate", since delivery of SIGQUIT to the startup subprocess will result in killing the waiting recovery_command. Also, this makes Query Cancel and statement_timeout apply to scripts being run from backends via system(). (There is no support in the core backend for that, but it's widely done using untrusted PLs.) Per gripe from Stephen Harris and subsequent discussion.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian
2006-07-13Allow include files to compile own their own.Bruce Momjian
Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-01-11Create a standard function pg_sleep() to sleep for a specified amount of time.Tom Lane
Replace the former ad-hoc implementation used in the regression tests. Joachim Wieland
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-09-16Rename pg_complete_relation_size() to pg_total_relation_size(), for theNeil Conway
sake of brevity and clarity. Make pg_reload_conf(), pg_rotate_logfile(), and pg_cancel_backend() return a boolean rather than an integer to indicate success or failure. Along the way, make some minor cleanups to dbsize.c -- in particular, use elog() rather than ereport() for "shouldn't happen" error conditions, and remove some of the more flagrant violations of the Postgres indentation conventions. Catalog version bumped.
2005-08-12Code & docs review for server instrumentation patch. File timestampsTom Lane
should surely be timestamptz not timestamp; fix some but not all of the holes in check_and_make_absolute(); other minor cleanup. Also put in the missed catversion bump.
2005-08-12Add files to do read I/O on the cluster directory:Bruce Momjian
pg_stat_file() pg_read_file() pg_ls_dir() pg_reload_conf() pg_rotate_logfile() Dave Page Andreas Pflug
2005-07-04Arrange for the postmaster (and standalone backends, initdb, etc) toTom Lane
chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
2005-06-19Simplify uses of readdir() by creating a function ReadDir() thatTom Lane
includes error checking and an appropriate ereport(ERROR) message. This gets rid of rather tedious and error-prone manipulation of errno, as well as a Windows-specific bug workaround, at more than a dozen call sites. After an idea in a recent patch by Heikki Linnakangas.
2005-05-19Split the shared-memory array of PGPROC pointers out of the sinvalTom Lane
communication structure, and make it its own module with its own lock. This should reduce contention at least a little, and it definitely makes the code seem cleaner. Per my recent proposal.
2005-05-10Back out check for unreferenced files.Bruce Momjian
Heikki Linnakangas
2005-05-02Check the file system on postmaster startup and report any unreferencedBruce Momjian
files in the server log. Heikki Linnakangas
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-10-12Message style revisionsPeter Eisentraut
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-08-03Add functions pg_start_backup, pg_stop_backup to create backup labelTom Lane
and history files as per recent discussion. While at it, remove pg_terminate_backend, since we have decided we do not have time during this release cycle to address the reliability concerns it creates. Split the 'Miscellaneous Functions' documentation section into 'System Information Functions' and 'System Administration Functions', which hopefully will draw the eyes of those looking for such things.
2004-07-02Andreas Pflug wrote:Joe Conway
From an idea of Bruce, the attached patch implements the function pg_tablespace_databases(oid) RETURNS SETOF oid which delivers as set of database oids having objects in the selected tablespace, enabling an admin to examine only the databases affecting the tablespace for objects instead of scanning all of them. initdb forced
2004-06-02Per previous discussions, here are two functions to send INT and TERMBruce Momjian
(cancel and terminate) signals to other backends. They permit only INT and TERM, and permits sending only to postgresql backends. Magnus Hagander
2004-05-21Integrate src/timezone library for all platforms. There is more we canTom Lane
and should do now that we control our own destiny for timezone handling, but this commit gets the bulk of the picayune diffs in place. Magnus Hagander and Tom Lane.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-06-27Fix compile warnings.Tom Lane
2003-06-27First batch of object rename commands.Peter Eisentraut
2003-02-13The "random" regression test uses a function called oidrand(), whichBruce Momjian
takes two parameters, an OID x and an integer y, and returns "true" with probability 1/y (the OID argument is ignored). This can be useful -- for example, it can be used to select a random sampling of the rows in a table (which is what the "random" regression test uses it for). This patch removes that function, because it was old and messy. The old function had the following problems: - it was undocumented - it was poorly named - it was designed to workaround an optimizer bug that no longer exists (the OID argument is to ensure that the optimizer won't optimize away calls to the function; AFAIK marking the function as 'volatile' suffices nowadays) - it used a different random-number generation technique than the other PSRNG-related functions in the backend do (it called random() like they do, but it had its own logic for setting a set and deciding when to reseed the RNG). Ok, this patch removes oidrand(), oidsrand(), and userfntest(), and improves the SGML docs a little bit (un-commenting the setseed() documentation). Neil Conway
2002-09-04pgindent run.Bruce Momjian
2002-09-02Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian
because c.h has sys/types.h.
2002-08-20Add current_database().Bruce Momjian
> Quick system function to pull out the current database. > > I've used this a number of times to allow stored procedures to find out > where they are. Especially useful for those that do logging or hit a > remote server. > > It's called current_database() to match with current_user(). It's also a necessity for an informational schema. The catalog (database) name is required in a number of places. Rod Taylor
2002-06-20Update copyright to 2002.Bruce Momjian
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-01-24Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian
2000-08-07Clean up bogosities in use of random(3) and srandom(3) --- do not assumeTom Lane
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-06-05Latest round of fmgr updates. All functions with bool,char, or int2Tom Lane
inputs have been converted to newstyle. This should go a long way towards fixing our portability problems with platforms where char and short parameters are passed differently from int-width parameters. Still more to do for the Alpha port however.
2000-01-26Add:Bruce Momjian
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
1999-07-15Remove unused #includes in *.c files.Bruce Momjian
1999-02-13Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian
1998-09-01OK, folks, here is the pgindent output.Bruce Momjian
1998-09-01Renaming cleanup, no pgindent yet.Bruce Momjian
1998-06-09Auto-seed random so user's can't request random values based onBruce Momjian
our postmaster random seed used from cancel.
1998-02-24Remove #include "port-protos.h", since we no longer use itMarc G. Fournier
From: Frank Ridderbusch <ridderbusch.pad@sni.de>
1997-12-19More cleanups. I can now compile without PORTNAME being defined nMarc G. Fournier
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-09-08Used modified version of indent that understands over 100 typedefs.Bruce Momjian
1997-09-08Another PGINDENT run that changes variable indenting and case label ↵Bruce Momjian
indenting. Also static variable indenting.
1997-09-07Massive commit to run PGINDENT on all *.c and *.h files.Bruce Momjian