DEALLOCATE(7)

๐Ÿ’… DEALLOCATE

okay bestie, this is the PostgreSQL 18.6 manual page for DEALLOCATE โ€” the lil cleanup queen of prepared statements. let's get into it โœจ


๐ŸŒธ NAME

DEALLOCATE โ€” deallocate a prepared statement. that's it, that's the whole vibe. it's the "ok bye" button for a statement you prepped earlier ๐Ÿซถ


โœจ SYNOPSIS

DEALLOCATE [ PREPARE ] { name | ALL }

look at her. so simple. so iconic. ๐Ÿ‘‘


๐Ÿฆ‹ DESCRIPTION

so DEALLOCATE is what you use to deallocate a previously prepared SQL statement. like, you prepped it, you used it, and now you're releasing it back into the wild. no cap.

and here's the tea: if you don't explicitly deallocate a prepared statement, it gets deallocated anyway when the session ends. so it's not like it's gonna haunt you forever โ€” but if you want it gone now, this is your girl ๐Ÿ’…

want the full lore on prepared statements? go read PREPARE(7). it's giving prerequisites, fr fr.


๐ŸŽ€ PARAMETERS

  • PREPARE โ€” this key word is ignored. literally does nothing. it's just there for decoration, main character energy with zero lines. not me putting a whole keyword in the synopsis that gets ignored ๐Ÿ˜ญ
  • name โ€” the name of the prepared statement you wanna deallocate. tell her who she is and send her off ๐Ÿฆ‹
  • ALL โ€” deallocate all prepared statements. every single one. scorched earth. slay.

๐Ÿ’œ COMPATIBILITY

so the SQL standard does include a DEALLOCATE statement โ€” but plot twist, it's only for use in embedded SQL. so like, don't go comparing yourself to the standard's version, they're different girlies. iykyk.


๐Ÿ‘‘ SEE ALSO

go read those too, bestie, they're the whole friend group ๐Ÿ’–


and that's a wrap on DEALLOCATE(7) from the PostgreSQL 18.6 documentation, dated 2026. thank you for coming to my ted talk, deallocate responsibly, and remember: if you don't clean up your prepared statements, the session will do it for you when it ends. periodt. ๐Ÿ’…โœจ๐ŸŽ€