aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/misc.c
Commit message (Collapse)AuthorAge
* Move relpath() to libpgcommonAlvaro Herrera2013-02-21
| | | | | | | This enables non-backend code, such as pg_xlogdump, to use it easily. The previous location, in src/backend/catalog/catalog.c, made that essentially impossible because that file depends on many backend-only facilities; so this needs to live separately.
* Update copyrights for 2013Bruce Momjian2013-01-01
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Support automatically-updatable views.Tom Lane2012-12-08
| | | | | | | | | | | | | | | | | This patch makes "simple" views automatically updatable, without the need to create either INSTEAD OF triggers or INSTEAD rules. "Simple" views are those classified as updatable according to SQL-92 rules. The rewriter transforms INSERT/UPDATE/DELETE commands on such views directly into an equivalent command on the underlying table, which will generally have noticeably better performance than is possible with either triggers or user-written rules. A view that has INSTEAD OF triggers or INSTEAD rules continues to operate the same as before. For the moment, security_barrier views are not considered simple. Also, we do not support WITH CHECK OPTION. These features may be added in future. Dean Rasheed, reviewed by Amit Kapila
* Have pg_terminate/cancel_backend not ERROR on non-existent processesAlvaro Herrera2012-09-27
| | | | | | | | | | | | | | | | | | This worked fine for superusers, but not for ordinary users trying to cancel their own processes. Tweak the order the checks are done in so that we correctly return SIGNAL_BACKEND_ERROR (which current callers know to ignore without erroring out) so that an ordinary user can loop through a resultset without fearing that a process might exit in the middle of said looping -- causing the remaining processes to go unsignalled. Incidentally, the last in-core caller of IsBackendPid() is now gone. However, the function is exported and must remain in place, because there are plenty of callers in external modules. Author: Josh Kupershmidt Reviewed by Noah Misch
* Fix redundant wordingAlvaro Herrera2012-08-07
|
* Allow pg_terminate_backend() to be used on backends with matching role.Robert Haas2012-06-26
| | | | | | | | A similar change was made previously for pg_cancel_backend, so now it all matches again. Dan Farina, reviewed by Fujii Masao, Noah Misch, and Jeff Davis, with slight kibitzing on the doc changes by me.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* Make pg_tablespace_location(0) return the database's default tablespace.Tom Lane2012-04-10
| | | | | | | This definition is convenient when applying the function to the reltablespace column of pg_class, since that's what zero means there; and it doesn't interfere with any other plausible use of the function. Per gripe from Bruce Momjian.
* Add COLLATION FOR expressionPeter Eisentraut2012-03-02
| | | | reviewed by Jaime Casanova
* Allow a user to kill his own queries using pg_cancel_backend()Magnus Hagander2012-01-15
| | | | | | | | | Allows a user to use pg_cancel_queries() to cancel queries in other backends if they are running under the same role. pg_terminate_backend() still requires superuser permissoins. Short patch, many authors working on the bikeshed: Magnus Hagander, Josh Kupershmidt, Edward Muller, Greg Smith.
* Update copyright notices for year 2012.Bruce Momjian2012-01-01
|
* Fix corner cases in readlink() usage.Tom Lane2011-12-07
| | | | | | Make sure all calls are protected by HAVE_READLINK, and get the buffer overflow tests right. Be a bit more paranoid about string length in _tarWriteHeader(), too.
* Better error reporting if the link target is too longMagnus Hagander2011-12-07
| | | | | This situation won't set errno, so using %m will give an incorrect error message.
* Remove spclocation field from pg_tablespaceMagnus Hagander2011-12-07
| | | | | | | | Instead, add a function pg_tablespace_location(oid) used to return the same information, and do this by reading the symbolic link. Doing it this way makes it possible to relocate a tablespace when the database is down by simply changing the symbolic link.
* Move Timestamp/Interval typedefs and basic macros into datatype/timestamp.h.Tom Lane2011-09-09
| | | | | | | | | | | As per my recent proposal, this refactors things so that these typedefs and macros are available in a header that can be included in frontend-ish code. I also changed various headers that were undesirably including utils/timestamp.h to include datatype/timestamp.h instead. Unsurprisingly, this showed that half the system was getting utils/timestamp.h by way of xlog.h. No actual code changes here, just header refactoring.
* Remove unnecessary #include references, per pgrminclude script.Bruce Momjian2011-09-01
|
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0Bruce Momjian2010-02-26
|
* Please tablespace directories in their own subdirectory so pg_migratorBruce Momjian2010-01-12
| | | | | | | can upgrade clusters without renaming the tablespace directories. New directory structure format is, e.g.: $PGDATA/pg_tblspc/20981/PG_8.5_201001061/719849/83292814
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* Tweak the core scanner so that it can be used by plpgsql too.Tom Lane2009-07-14
| | | | | | | | | | | | | | Changes: Pass in the keyword lookup array instead of having it be hardwired. (This incidentally allows elimination of some duplicate coding in ecpg.) Re-order the token declarations in gram.y so that non-keyword tokens have numbers that won't change when keywords are added or removed. Add ".." and ":=" to the set of tokens recognized by scan.l. (Since these combinations are nowhere legal in core SQL, this does not change anything except the precise wording of the error you get when you write this.)
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Revert current_query() change to use debug_query_string again; add comment.Bruce Momjian2009-01-08
|
* Have current_query() use ActivePortal->sourceText rather thanBruce Momjian2009-01-07
| | | | | debug_query_string; this allows current_query() to be more accurate; docs updated; per idea from Tom
* Add comment that it is difficult to access the more accurateBruce Momjian2009-01-07
| | | | 'query_string' from current_query().
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Better descriptions in pg_get_keywords(), consistent with the documentationPeter Eisentraut2008-12-05
| | | | | appendix on key words. catdesc was originally intended as computer-readable, but since we ended up adding catcode, we can have more elaborate descriptions.
* Add pg_typeof() function.Tom Lane2008-11-03
| | | | Brendan Jurd
* Remove obsolete internal functions istrue, isfalse, isnottrue, isnotfalse,Peter Eisentraut2008-10-05
| | | | | nullvalue, nonvalue. A long time ago, these were used to implement the SQL constructs IS TRUE, etc.
* Add a function pg_get_keywords() to let clients find out the set of keywordsTom Lane2008-07-03
| | | | known to the SQL parser. Dave Page
* Re-enable pg_terminate_backend() using SIGTERM. SIGTERM testing stillBruce Momjian2008-04-17
| | | | needed.
* Revert addition of pg_terminate_backend() because of race conditions.Bruce Momjian2008-04-15
|
* Add pg_terminate_backend() to allow terminating only a single session.Bruce Momjian2008-04-15
|
* Implement current_query(), that shows the currently executing query.Bruce Momjian2008-04-04
| | | | | | | | At the same time remove dblink/dblink_current_query() as it is no longer necessary *BACKWARD COMPATIBILITY ISSUE* for dblink Tomas Doran
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Provide for logfiles in machine readable CSV format. In consequence, renameAndrew Dunstan2007-08-19
| | | | | | redirect_stderr to logging_collector. Original patch from Arul Shaji, subsequently modified by Greg Smith, and then heavily modified by me.
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* On systems that have setsid(2) (which should be just about everything exceptTom Lane2006-11-21
| | | | | | | | | | | | | 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.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-14
|
* Allow include files to compile own their own.Bruce Momjian2006-07-13
| | | | | | | 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.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Create a standard function pg_sleep() to sleep for a specified amount of time.Tom Lane2006-01-11
| | | | | Replace the former ad-hoc implementation used in the regression tests. Joachim Wieland
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Rename pg_complete_relation_size() to pg_total_relation_size(), for theNeil Conway2005-09-16
| | | | | | | | | | | | | | 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.
* Code & docs review for server instrumentation patch. File timestampsTom Lane2005-08-12
| | | | | | 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.
* Add files to do read I/O on the cluster directory:Bruce Momjian2005-08-12
| | | | | | | | | | | pg_stat_file() pg_read_file() pg_ls_dir() pg_reload_conf() pg_rotate_logfile() Dave Page Andreas Pflug
* Arrange for the postmaster (and standalone backends, initdb, etc) toTom Lane2005-07-04
| | | | | | | | 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.
* Simplify uses of readdir() by creating a function ReadDir() thatTom Lane2005-06-19
| | | | | | | 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.