summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/man7/DISCARD.7
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /doc/src/sgml/man7/DISCARD.7
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/man7/DISCARD.7')
-rw-r--r--doc/src/sgml/man7/DISCARD.796
1 files changed, 96 insertions, 0 deletions
diff --git a/doc/src/sgml/man7/DISCARD.7 b/doc/src/sgml/man7/DISCARD.7
new file mode 100644
index 0000000..5d47352
--- /dev/null
+++ b/doc/src/sgml/man7/DISCARD.7
@@ -0,0 +1,96 @@
+'\" t
+.\" Title: DISCARD
+.\" Author: The PostgreSQL Global Development Group
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 2024
+.\" Manual: PostgreSQL 16.2 Documentation
+.\" Source: PostgreSQL 16.2
+.\" Language: English
+.\"
+.TH "DISCARD" "7" "2024" "PostgreSQL 16.2" "PostgreSQL 16.2 Documentation"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+DISCARD \- discard session state
+.SH "SYNOPSIS"
+.sp
+.nf
+DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }
+.fi
+.SH "DESCRIPTION"
+.PP
+\fBDISCARD\fR
+releases internal resources associated with a database session\&. This command is useful for partially or fully resetting the session\*(Aqs state\&. There are several subcommands to release different types of resources; the
+\fBDISCARD ALL\fR
+variant subsumes all the others, and also resets additional state\&.
+.SH "PARAMETERS"
+.PP
+PLANS
+.RS 4
+Releases all cached query plans, forcing re\-planning to occur the next time the associated prepared statement is used\&.
+.RE
+.PP
+SEQUENCES
+.RS 4
+Discards all cached sequence\-related state, including
+\fBcurrval()\fR/\fBlastval()\fR
+information and any preallocated sequence values that have not yet been returned by
+\fBnextval()\fR\&. (See
+CREATE SEQUENCE (\fBCREATE_SEQUENCE\fR(7))
+for a description of preallocated sequence values\&.)
+.RE
+.PP
+TEMPORARY or TEMP
+.RS 4
+Drops all temporary tables created in the current session\&.
+.RE
+.PP
+ALL
+.RS 4
+Releases all temporary resources associated with the current session and resets the session to its initial state\&. Currently, this has the same effect as executing the following sequence of statements:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+CLOSE ALL;
+SET SESSION AUTHORIZATION DEFAULT;
+RESET ALL;
+DEALLOCATE ALL;
+UNLISTEN *;
+SELECT pg_advisory_unlock_all();
+DISCARD PLANS;
+DISCARD TEMP;
+DISCARD SEQUENCES;
+.fi
+.if n \{\
+.RE
+.\}
+.RE
+.SH "NOTES"
+.PP
+\fBDISCARD ALL\fR
+cannot be executed inside a transaction block\&.
+.SH "COMPATIBILITY"
+.PP
+\fBDISCARD\fR
+is a
+PostgreSQL
+extension\&.