ALTER_SCHEMA(7pg15)

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

πŸ’– NAME πŸ’–

Okay so this is ALTER_SCHEMA(7) from the PostgreSQL 15.19 docs β€” the page for ALTER_SCHEMA, and its whole thing is: change the definition of a schema. That's it, that's the vibe. ✨

✨ SYNOPSIS ✨

ALTER SCHEMA name RENAME TO new_name
ALTER SCHEMA name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }

🌸 DESCRIPTION 🌸

ALTER SCHEMA changes the definition of a schema. Main character behaviour, honestly.

You must own the schema to use ALTER SCHEMA. No cap.

To rename a schema you must also have the CREATE privilege for the database.

To alter the owner, you must also be a direct or indirect member of the new owning role, and you must have the CREATE privilege for the database. (Note that superusers have all these privileges automatically β€” they're literally built different.) πŸ‘‘

πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of an existing schema. Like, the schema you're about to glow-up. πŸ’…
  • new_name β€” the new name of the schema. The new name cannot begin with pg_, because those names are reserved for system schemas. So don't try it, bestie. 🫢
  • new_owner β€” the new owner of the schema. Handing over the keys, etc. πŸ”‘

πŸ¦‹ COMPATIBILITY πŸ¦‹

There is no ALTER SCHEMA statement in the SQL standard. Nope, not a thing there. πŸ’€

πŸ’œ SEE ALSO πŸ’œ


And that's the page, bestie β€” PostgreSQL 15.19, dated 2026. Slay. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from