ALTER_SCHEMA(7pg13)

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

okay bestie, this is the ALTER_SCHEMA(7) page from the PostgreSQL 13.23 Documentation πŸ’… it’s short, it’s iconic, and we’re getting into it.

πŸ’– NAME πŸ’–

  • ALTER_SCHEMA β€” change the definition of a schema. slay.

✨ SYNOPSIS ✨

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

πŸ¦‹ DESCRIPTION πŸ¦‹

ALTER SCHEMA changes the definition of a schema. literally its whole job.

You must own the schema to use ALTER SCHEMA. 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.) πŸ‘‘

πŸŽ€ PARAMETERS πŸŽ€

  • name β€” the name of an existing schema. bless.
  • new_name β€” the new name of the schema. hard rule bestie: the new name cannot begin with pg_, as such names are reserved for system schemas. 🚫
  • new_owner β€” the new owner of the schema. hand over the crown. πŸ‘‘

🌈 COMPATIBILITY 🌈

There is no ALTER SCHEMA statement in the SQL standard. not a single one. wild. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’– that’s the whole vibe β€” brought to you by PostgreSQL 13.23, dated 2025. periodt. 🫢

πŸ“¦ where this page comes from