ALTER_SCHEMA(7pg15)
π 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 withpg_, 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 π
CREATE SCHEMA(CREATE_SCHEMA(7))DROP SCHEMA(DROP_SCHEMA(7))
And that's the page, bestie β PostgreSQL 15.19, dated 2026. Slay. π β¨π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql15 15.19-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms