3 PostgreSQL documentation
6 <refentry id=
"SQL-DISCARD">
8 <refentrytitle id=
"SQL-DISCARD-TITLE">DISCARD
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>DISCARD
</refname>
15 <refpurpose>discard session state
</refpurpose>
18 <indexterm zone=
"sql-discard">
19 <primary>DISCARD
</primary>
24 DISCARD { ALL | PLANS | TEMPORARY | TEMP }
29 <title>Description
</title>
32 <command>DISCARD<
/> releases internal resources associated with a
33 database session. These resources are normally released at the end
38 <command>DISCARD TEMP<
/> drops all temporary tables created in the
39 current session.
<command>DISCARD PLANS<
/> releases all internally
40 cached query plans.
<command>DISCARD ALL<
/> resets a session to
41 its original state, discarding temporary resources and resetting
42 session-local configuration changes.
47 <title>Parameters
</title>
52 <term><literal>TEMPORARY
</literal> or
<literal>TEMP
</literal></term>
55 Drops all temporary tables created in the current session.
61 <term><literal>PLANS
</literal></term>
64 Releases all cached query plans.
70 <term><literal>ALL
</literal></term>
73 Releases all temporary resources associated with the current
74 session and resets the session to its initial state.
75 Currently, this has the same effect as executing the following sequence
78 SET SESSION AUTHORIZATION DEFAULT;
83 SELECT pg_advisory_unlock_all();
98 <command>DISCARD ALL<
/> cannot be executed inside a transaction block.
103 <title>Compatibility
</title>
106 <command>DISCARD
</command> is a
<productname>PostgreSQL
</productname> extension.