DEALLOCATE(7)

πŸ“¦ version 15.19, in opensuse-leap 16.0

πŸ’… DEALLOCATE(7) β€” the "let it go" of prepared statements

Okay bestie, so this is the DEALLOCATE page from the PostgreSQL 15.19 Documentation. Yes, that's a manual name up there in the corner β€” we're in section 7 and it's giving "SQL command" energy. Let's get into it 🫢


✨ SYNOPSIS ✨

DEALLOCATE [ PREPARE ] { name | ALL }

Look at her. Look at the syntax. PREPARE is optional, and then you either name your statement or you go ALL and nuke the whole collection. Iconic either way πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So DEALLOCATE is literally the command you use to deallocate a previously prepared SQL statement β€” like, you prepared a statement earlier and now you're cleaning up after yourself, main character behavior honestly ✨

And here's the tea: if you do not explicitly deallocate a prepared statement, it gets deallocated when the session ends. So the universe (the session) does it for you eventually. But bestie, you can also just be a responsible queen and do it yourself πŸ’–

For more info on prepared statements, go read PREPARE(7) β€” it's the origin story, iykyk πŸ“–


πŸŽ€ PARAMETERS πŸŽ€

  • PREPARE β€” This key word is ignored. That's it. That's the whole thing. She's there, she's decorative, she does nothing. A true icon of doing the absolute least πŸ™ˆ
  • name β€” The name of the prepared statement you want to deallocate. Like calling someone out by name, but nice πŸ’œ
  • ALL β€” Deallocate all prepared statements. Every single one. No survivors. ALL said "not me being the main character of this command" πŸ”₯
Lowkey a vibe check reminder: ALL means all of them, so don't come crying to me when your prepared statements are gone 😭

🌈 COMPATIBILITY 🌈

The SQL standard does include a DEALLOCATE statement, ngl β€” but it's only for use in embedded SQL. So like, similar name, different context. Don't get it twisted 🧚


⭐ SEE ALSO ⭐

The holy trinity of prepare / execute / deallocate. Go read them all, bestie, they're like a trilogy πŸ“šβœ¨


That's the whole page, bestie β€” shipped to you from PostgreSQL 15.19, dated 2026. Now go deallocate something responsibly πŸ’–πŸ’…πŸŽ€

πŸ“¦ where this page comes from