DISCARD(7)
π NAME π
DISCARD β discard session state.
Okay so this is the DISCARD(7) manual page, and it's literally all about clearing out session state, bestie. It's from the PostgreSQL 14.24 docs. Slay.
β¨ SYNOPSIS β¨
DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }
π¦ DESCRIPTION π¦
DISCARD releases internal resources associated with a database session. This command is useful for partially or fully resetting the session's state.
There are several subcommands to release different types of resources. The DISCARD ALL variant subsumes all the others, and also resets additional state. Periodt.
π PARAMETERS π
PLANSβ Releases all cached query plans, forcing re-planning to occur the next time the associated prepared statement is used. It's giving "forget what I thought I knew and look again." πSEQUENCESβ Discards all cached sequence-related state, includingcurrval()/lastval()information and any preallocated sequence values that have not yet been returned bynextval(). (SeeCREATE SEQUENCE(CREATE_SEQUENCE(7)) for a description of preallocated sequence values.) π«TEMPORARYorTEMPβ Drops all temporary tables created in the current session. Bye, temp tables! π«ΆALLβ 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:
CLOSE ALL;
SET SESSION AUTHORIZATION DEFAULT;
RESET ALL;
DEALLOCATE ALL;
UNLISTEN *;
SELECT pg_advisory_unlock_all();
DISCARD PLANS;
DISCARD TEMP;
DISCARD SEQUENCES;
π NOTES π
DISCARD ALL cannot be executed inside a transaction block. No cap, that's the rule. π«
π COMPATIBILITY π
DISCARD is a PostgreSQL extension.
Stay gorgeous, bestie β this was the DISCARD(7) page from the PostgreSQL 14.24 docs, dated 2026. Mwah! πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql14 14.24-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms