Reference: Discard Statement
Discard allows resetting the current database session.
Usage example:
-- Reset the complete session state, allowing connection re-use
discard all;Options
allDiscard all session state. This includes prepared statements, temporary tables, and session settings. After a discard all, the session behaves like a fresh connection. This is useful when a connection is shared between multiple client threads that all depend on having a pristine connection.plansDiscard cached query plans for prepared statements. The prepared statements themselves remain valid. CedarDB automatically re-plans queries periodically, so you should not need to execute this manually.sequencesDiscard cached sequence state. This currently has no effect.temp,temporaryDrop all temporary tables, views, sequences, and functions of the session.
DISCARD ALL cannot run inside a transaction block.
Permissions
DISCARD requires no privileges.