ALTER SCHEMA current_schema_name OWNER TO new_user;
Parameter or clause
Description
OWNER TO
This clause changes the owner of the schema. To alter the owner, you must be able to SET ROLE to the new owning role, and you must have the CREATEDB privilege. Note that superusers have all these privileges automatically.
new_user
The new owner you want to assign to the schema.
-- Change the owner of the schema named "schema1" to user "user1"ALTER SCHEMA schema1 OWNER TO user1;
ALTER SCHEMA current_schema_name RENAME TO new_name;
Parameter or clause
Description
RENAME TO
This clause changes the name of the schema. To rename a schema you must also have the CREATE privilege for the database. Note that superusers have the privilege automatically.
new_name
The new name of the schema.
-- Rename the schema named "schema0" to "schema1".ALTER SCHEMA schema0 RENAME TO schema1;
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"RisingWave","colors":{"primary":"#005eec","light":"#005eec","dark":"#005eec"},"logo":{"light":"https://mintcdn.com/risingwavelabs/MBiw07hESa08PLsp/logo/light.svg?fit=max\u0026auto=format\u0026n=MBiw07hESa08PLsp\u0026q=85\u0026s=ec9c31744f8c3ddaa5c37f6f7fd0385b","dark":"https://mintcdn.com/risingwavelabs/MBiw07hESa08PLsp/logo/dark.svg?fit=max\u0026auto=format\u0026n=MBiw07hESa08PLsp\u0026q=85\u0026s=5faa0cc3c55a9407df9bb353ee579e89","href":"https://risingwave.com/"},"favicon":"https://mintcdn.com/risingwavelabs/eqqtg34aUutkXCuz/favicon.png?fit=max\u0026auto=format\u0026n=eqqtg34aUutkXCuz\u0026q=85\u0026s=32d724d78a6ff3342f31bed536427c8f","background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://risingwave.com/resources/?filter=blogs","label":"Blog"}],"primary":{"type":"button","label":"Sign up free","href":"https://cta-service-cms2.hubspot.com/web-interactives/public/v1/track/redirect?encryptedPayload=AVxigLIVNzabNcOPWI6bnbgE5v5wBhWy6pk6dNZ0jpoHYTJVXYdKJ2sN2%2Bz81tvbqU9obUFnA6qJBV3VfxEI3LOXQz%2FR1xANlR5nhw9CzFWt250u2%2B%2FfsHip8lVRCRiV%2FX0l10HpM%2BZWdr%2FmPAe%2BTHYRotiKZ1nJ494JNXcirwOZXbhlh5RTBgXXdxwxHyst\u0026webInteractiveContentId=183953770777\u0026portalId=24308934"}},"footer":{"socials":{"github":"https://github.com/risingwavelabs/risingwave","x":"https://go.risingwave.com/twitter","linkedin":"https://go.risingwave.com/linkedin","slack":"https://go.risingwave.com/slack","youtube":"https://go.risingwave.com/youtube"}},"fonts":{"heading":{"family":"Inter","format":"woff2"},"body":{"family":"Inter","format":"woff2"}},"integrations":{"ga4":{"measurementId":"G-VG98SVDEYE"},"gtm":{"tagId":"GTM-WT9WLCBX"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Join Slack community","icon":"slack","href":"https://go.risingwave.com/slack"},{"anchor":"GitHub","icon":"github","href":"https://github.com/risingwavelabs/risingwave"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"risingwavelabs","hasAudioNarration":false,"actualSubdomain":"risingwavelabs","customDomains":["docs.risingwave.com"],"gitSource":{"type":"github","owner":"risingwavelabs","repo":"risingwave-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae2f80654f097af7a2829f3","collectionId":"29a86107-b8a8-45db-88dd-3fdfd9fd5a8a","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae2f80654f097af7a2829f3"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae2f80bcd14242e00951ba7","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Guides","count":274},{"language":"default","tag":"SQL/Python/UDFs","count":156},{"language":"default","tag":"SQL reference","count":148},{"language":"default","tag":"Work with data","count":117},{"language":"default","tag":"Commands","count":99},{"language":"default","tag":"Cloud","count":62},{"language":"default","tag":"Ingest data","count":52},{"language":"default","tag":"Apache Iceberg™","count":37},{"language":"default","tag":"Deliver data","count":35},{"language":"default","tag":"Install \u0026 Operate","count":32}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"@font-face{font-family:'Monument Grotesk';src:url(https://fonts.gstatic.com/s/inter/v18/UcCo3FwrK3iLTcviYwYZ8UA3.woff2);font-weight:400;font-style:normal;font-display:swap}h1,h2,h3{font-family:'monument grotesk';letter-spacing:normal!important}"}],"page":{"pagePath":"sql/commands/sql-alter-schema","slug":"/sql/commands/sql-alter-schema","pageMetadata":{"title":"ALTER SCHEMA","description":"The `ALTER SCHEMA` command modifies the definition of a schema. To use this command, you must own the schema.","href":"/sql/commands/sql-alter-schema"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"The \", _jsx(_components.code, {\n children: \"ALTER SCHEMA\"\n }), \" command modifies the definition of a schema. To use this command, you must own the schema.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`syntax`,children:`Syntax`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SCHEMA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` current_schema_name`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` alter_option;`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.em,{children:_jsx(_components.code,{children:`alter_option`})}),` depends on the operation you want to perform on the schema. For all supported clauses, see the sections below.`]}),`\n`,_jsx(Heading,{level:`2`,id:`clause`,children:`Clause`}),`\n`,_jsx(Heading,{level:`3`,id:`owner-to`,children:_jsx(_components.code,{children:`OWNER TO`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SCHEMA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` current_schema_name`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` OWNER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new_user;`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Parameter or clause`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.strong,{children:`OWNER TO`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`This clause changes the owner of the schema. To alter the owner, you must be able to SET ROLE to the new owning role, and you must have the CREATEDB privilege. Note that superusers have all these privileges automatically.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.em,{children:`new_user`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`The new owner you want to assign to the schema.`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Change the owner of the schema named \"schema1\" to user \"user1\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SCHEMA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` schema1 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`OWNER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` user1;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`rename-to`,children:_jsx(_components.code,{children:`RENAME TO`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SCHEMA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` current_schema_name`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` RENAME `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` new_name;`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Parameter or clause`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.strong,{children:`RENAME TO`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`This clause changes the name of the schema. To rename a schema you must also have the CREATE privilege for the database. Note that superusers have the privilege automatically.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.em,{children:`new_name`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`The new name of the schema.`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Rename the schema named \"schema0\" to \"schema1\".`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SCHEMA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` schema0 RENAME `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`TO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` schema1;`})]}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"ALTER SCHEMA","description":"The `ALTER SCHEMA` command modifies the definition of a schema. To use this command, you must own the schema.","href":"/sql/commands/sql-alter-schema"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Syntax","slug":"syntax","depth":2,"children":[]},{"title":"Clause","slug":"clause","depth":2,"children":[{"title":"OWNER TO","slug":"owner-to","depth":3,"children":[]},{"title":"RENAME TO","slug":"rename-to","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"risingwavelabs","siteName":"RisingWave","title":"ALTER SCHEMA - RisingWave","navMaps":{"firstHrefInVersion":{"Current (v3.0)":{"href":"/sql/commands/sql-alter-schema","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-01-22T08:22:17.281Z","originalFileLocation":"sql/commands/sql-alter-schema.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The ALTER SCHEMA command modifies the definition of a schema. To use this command, you must own the schema.\">\u003cmeta data-mint-head name=\"application-name\" content=\"RisingWave\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"ALTER SCHEMA - RisingWave\">\u003cmeta data-mint-head property=\"og:description\" content=\"The ALTER SCHEMA command modifies the definition of a schema. To use this command, you must own the schema.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"RisingWave\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.risingwave.com/sql/commands/sql-alter-schema\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://risingwavelabs.mintlify.app/_mintlify/api/og/v2?division=Commands\u0026amp;title=ALTER+SCHEMA\u0026amp;description=The+%60ALTER+SCHEMA%60+command+modifies+the+definition+of+a+schema.+To+use+this+command%2C+you+must+own+the+schema.\u0026amp;theme=f623197ed300707840b7cb4e\u0026amp;signature=1a855becb3e271309de8e0653a5b664df8dc5b4aab2d51538e0c3510bb50b885\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"ALTER SCHEMA - RisingWave\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The ALTER SCHEMA command modifies the definition of a schema. To use this command, you must own the schema.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://risingwavelabs.mintlify.app/_mintlify/api/og/v2?division=Commands\u0026amp;title=ALTER+SCHEMA\u0026amp;description=The+%60ALTER+SCHEMA%60+command+modifies+the+definition+of+a+schema.+To+use+this+command%2C+you+must+own+the+schema.\u0026amp;theme=f623197ed300707840b7cb4e\u0026amp;signature=1a855becb3e271309de8e0653a5b664df8dc5b4aab2d51538e0c3510bb50b885\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/risingwavelabs/XB2VPvZUQ1sTe2fS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"RisingWave\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#005eec\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.risingwave.com/sql/commands/sql-alter-schema\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sql/commands/sql-alter-schema.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.risingwave.com/#organization\",\"name\":\"RisingWave\",\"url\":\"https://docs.risingwave.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/risingwavelabs/MBiw07hESa08PLsp/logo/light.svg?fit=max\u0026auto=format\u0026n=MBiw07hESa08PLsp\u0026q=85\u0026s=ec9c31744f8c3ddaa5c37f6f7fd0385b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.risingwave.com#website\",\"name\":\"RisingWave\",\"url\":\"https://docs.risingwave.com\",\"publisher\":{\"@id\":\"https://docs.risingwave.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema#webpage\",\"url\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema\",\"name\":\"ALTER SCHEMA\",\"description\":\"The ALTER SCHEMA command modifies the definition of a schema. To use this command, you must own the schema.\",\"dateModified\":\"2026-01-22T08:22:17.281Z\",\"isPartOf\":{\"@id\":\"https://docs.risingwave.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SQL reference\",\"item\":\"https://docs.risingwave.com/sql/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Commands\",\"item\":\"https://docs.risingwave.com/sql/commands/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"ALTER SCHEMA\",\"item\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema#article\",\"headline\":\"ALTER SCHEMA\",\"name\":\"ALTER SCHEMA\",\"description\":\"The ALTER SCHEMA command modifies the definition of a schema. To use this command, you must own the schema.\",\"url\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema\",\"mainEntityOfPage\":{\"@id\":\"https://docs.risingwave.com/sql/commands/sql-alter-schema#webpage\"},\"dateModified\":\"2026-01-22T08:22:17.281Z\",\"publisher\":{\"@id\":\"https://docs.risingwave.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.risingwave.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"RisingWave\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"RisingWave","nav":{"global":{"anchors":[{"anchor":"Join Slack community","icon":"slack","href":"https://go.risingwave.com/slack"},{"anchor":"GitHub","icon":"github","href":"https://github.com/risingwavelabs/risingwave"}]},"versions":[{"version":"Current (v3.0)","tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/get-started/intro"}]},{"tab":"Apache Iceberg™","pages":[{"title":"Apache Iceberg™","href":"/iceberg/overview"}]},{"tab":"SQL/Python/UDFs","groups":[{"group":"SQL reference","pages":[{"title":"SQL reference","sidebarTitle":"Overview","mode":"wide","href":"/sql/overview"},{"group":"Commands","pages":[{"title":"SQL commands","mode":"wide","sidebarTitle":"Overview","href":"/sql/commands/overview"},{"title":"ALTER CONNECTION","href":"/sql/commands/sql-alter-connection"},{"title":"ALTER DEFAULT PRIVILEGES","href":"/sql/commands/sql-alter-default-privileges"},{"title":"ALTER DATABASE","href":"/sql/commands/sql-alter-database"},{"title":"ALTER FRAGMENT","sidebarTitle":"ALTER FRAGMENT","href":"/sql/commands/sql-alter-fragment"},{"title":"ALTER FUNCTION","href":"/sql/commands/sql-alter-function"},{"title":"ALTER INDEX","href":"/sql/commands/sql-alter-index"},{"title":"ALTER MATERIALIZED VIEW","description":"The `ALTER MATERIALIZED VIEW` command modifies the metadata of a materialized view. To use this command, you must own the materialized view.","href":"/sql/commands/sql-alter-materialized-view"},{"title":"ALTER SCHEMA","href":"/sql/commands/sql-alter-schema"},{"title":"ALTER SECRET","description":"Use the `ALTER SECRET` command to alter the secrets that store sensitive credentials.","href":"/sql/commands/sql-alter-secret"},{"title":"ALTER SINK","href":"/sql/commands/sql-alter-sink"},{"title":"ALTER SOURCE","href":"/sql/commands/sql-alter-source"},{"title":"ALTER SUBSCRIPTION","href":"/sql/commands/sql-alter-subscription"},{"title":"ALTER SWAP","href":"/sql/commands/sql-alter-swap"},{"title":"ALTER SYSTEM","href":"/sql/commands/sql-alter-system"},{"title":"ALTER TABLE","href":"/sql/commands/sql-alter-table"},{"title":"ALTER USER","href":"/sql/commands/sql-alter-user"},{"title":"ALTER VIEW","href":"/sql/commands/sql-alter-view"},{"title":"AS CHANGELOG","href":"/sql/commands/sql-as-changelog"},{"title":"BEGIN","href":"/sql/commands/sql-begin"},{"title":"CANCEL JOBS","href":"/sql/commands/sql-cancel-jobs"},{"title":"COMMENT ON","href":"/sql/commands/sql-comment-on"},{"title":"COMMIT","href":"/sql/commands/sql-commit"},{"title":"COPY","href":"/sql/commands/sql-copy"},{"title":"CREATE AGGREGATE","href":"/sql/commands/sql-create-aggregate"},{"title":"CREATE CONNECTION","href":"/sql/commands/sql-create-connection"},{"title":"CREATE DATABASE","href":"/sql/commands/sql-create-database"},{"title":"CREATE FUNCTION","href":"/sql/commands/sql-create-function"},{"title":"CREATE INDEX","href":"/sql/commands/sql-create-index"},{"title":"CREATE MATERIALIZED VIEW","sidebarTitle":"CREATE MATERIALIZED VIEW","href":"/sql/commands/sql-create-mv"},{"title":"CREATE SCHEMA","href":"/sql/commands/sql-create-schema"},{"title":"CREATE SECRET","href":"/sql/commands/sql-create-secret"},{"title":"CREATE SINK INTO","href":"/sql/commands/sql-create-sink-into"},{"title":"CREATE SINK","href":"/sql/commands/sql-create-sink"},{"title":"CREATE SOURCE","href":"/sql/commands/sql-create-source"},{"title":"CREATE TABLE","href":"/sql/commands/sql-create-table"},{"title":"CREATE USER","href":"/sql/commands/sql-create-user"},{"title":"CREATE VIEW","href":"/sql/commands/sql-create-view"},{"title":"DELETE","href":"/sql/commands/sql-delete"},{"title":"DESCRIBE","href":"/sql/commands/sql-describe"},{"title":"DISCARD","href":"/sql/commands/sql-discard"},{"title":"DROP AGGREGATE","href":"/sql/commands/sql-drop-aggregate"},{"title":"DROP CONNECTION","href":"/sql/commands/sql-drop-connection"},{"title":"DROP DATABASE","href":"/sql/commands/sql-drop-database"},{"title":"DROP FUNCTION","href":"/sql/commands/sql-drop-function"},{"title":"DROP INDEX","href":"/sql/commands/sql-drop-index"},{"title":"DROP MATERIALIZED VIEW","href":"/sql/commands/sql-drop-mv"},{"title":"DROP SCHEMA","href":"/sql/commands/sql-drop-schema"},{"title":"DROP SECRET","href":"/sql/commands/sql-drop-secret"},{"title":"DROP SINK","href":"/sql/commands/sql-drop-sink"},{"title":"DROP SOURCE","href":"/sql/commands/sql-drop-source"},{"title":"DROP TABLE","href":"/sql/commands/sql-drop-table"},{"title":"DROP USER","href":"/sql/commands/sql-drop-user"},{"title":"DROP VIEW","href":"/sql/commands/sql-drop-view"},{"title":"EXPLAIN","href":"/sql/commands/sql-explain"},{"title":"EXPLAIN ANALYZE","href":"/sql/commands/sql-explain-analyze"},{"title":"FLUSH","href":"/sql/commands/sql-flush"},{"title":"GRANT","href":"/sql/commands/sql-grant"},{"title":"INSERT","href":"/sql/commands/sql-insert"},{"title":"RECOVER","href":"/sql/commands/sql-recover"},{"title":"REFRESH TABLE","href":"/sql/commands/sql-refresh-table"},{"title":"REPLACE SINK","href":"/sql/commands/sql-replace-sink"},{"title":"REVOKE","href":"/sql/commands/sql-revoke"},{"title":"SELECT","href":"/sql/commands/sql-select"},{"title":"SET BACKGROUND_DDL","href":"/sql/commands/sql-set-background-ddl"},{"title":"SET DML_WAIT_PERSISTENCE","href":"/sql/commands/sql-set-dml-wait-persistence"},{"title":"SET RW_IMPLICIT_FLUSH","href":"/sql/commands/sql-set-rw-implicit-flush"},{"title":"SET TIME ZONE","href":"/sql/commands/sql-set-time-zone"},{"title":"SET","href":"/sql/commands/sql-set"},{"title":"SHOW CLUSTER","href":"/sql/commands/sql-show-cluster"},{"title":"SHOW COLUMNS","href":"/sql/commands/sql-show-columns"},{"title":"SHOW CONNECTIONS","href":"/sql/commands/sql-show-connections"},{"title":"SHOW CREATE INDEX","href":"/sql/commands/sql-show-create-index"},{"title":"SHOW CREATE MATERIALIZED VIEW","href":"/sql/commands/sql-show-create-mv"},{"title":"SHOW CREATE SINK","href":"/sql/commands/sql-show-create-sink"},{"title":"SHOW CREATE SOURCE","href":"/sql/commands/sql-show-create-source"},{"title":"SHOW CREATE TABLE","href":"/sql/commands/sql-show-create-table"},{"title":"SHOW CREATE VIEW","href":"/sql/commands/sql-show-create-view"},{"title":"SHOW CURSORS","href":"/sql/commands/sql-show-cursors"},{"title":"SHOW DATABASES","href":"/sql/commands/sql-show-databases"},{"title":"SHOW FUNCTIONS","href":"/sql/commands/sql-show-functions"},{"title":"SHOW INDEXES","href":"/sql/commands/sql-show-indexes"},{"title":"SHOW INTERNAL TABLES","href":"/sql/commands/sql-show-internal-tables"},{"title":"SHOW JOBS","href":"/sql/commands/sql-show-jobs"},{"title":"SHOW MATERIALIZED VIEWS","href":"/sql/commands/sql-show-mv"},{"title":"SHOW PARAMETERS","href":"/sql/commands/sql-show-parameters"},{"title":"SHOW PROCESSLIST","href":"/sql/commands/sql-show-processlist"},{"title":"SHOW SCHEMAS","href":"/sql/commands/sql-show-schemas"},{"title":"SHOW SECRETS","href":"/sql/commands/sql-show-secrets"},{"title":"SHOW SINKS","href":"/sql/commands/sql-show-sinks"},{"title":"SHOW SOURCES","href":"/sql/commands/sql-show-sources"},{"title":"SHOW SUBSCRIPTIONS","href":"/sql/commands/sql-show-subscriptions"},{"title":"SHOW SUBSCRIPTION CURSORS","href":"/sql/commands/sql-show-subscription-cursors"},{"title":"SHOW TABLES","href":"/sql/commands/sql-show-tables"},{"title":"SHOW VIEWS","href":"/sql/commands/sql-show-views"},{"title":"START TRANSACTION","href":"/sql/commands/sql-start-transaction"},{"title":"UPDATE","href":"/sql/commands/sql-update"},{"title":"VACUUM","href":"/sql/commands/sql-vacuum"},{"title":"WAIT","href":"/sql/commands/sql-wait"}]},{"group":"Query syntax","pages":[{"title":"Query syntax","sidebarTitle":"Overview","href":"/sql/query-syntax/overview"},{"title":"Literals","href":"/sql/query-syntax/literals"},{"title":"Value expressions","href":"/sql/query-syntax/value-exp"},{"title":"Generated columns","href":"/sql/query-syntax/generated-columns"},{"title":"FROM clause","href":"/sql/query-syntax/from-clause"},{"title":"WHERE clause","href":"/sql/query-syntax/where-clause"},{"title":"GROUP BY clause","href":"/sql/query-syntax/group-by-clause"},{"title":"HAVING clause","href":"/sql/query-syntax/having-clause"},{"title":"ORDER BY clause","href":"/sql/query-syntax/order-by-clause"},{"title":"LIMIT clause","mode":"wide","href":"/sql/query-syntax/limit-clause"},{"title":"VALUES clause","href":"/sql/query-syntax/values-clause"},{"title":"Set operations","href":"/sql/query-syntax/set-operations"},{"title":"WITH clause","href":"/sql/query-syntax/with-clause"},{"title":"WITH ORDINALITY clause","href":"/sql/query-syntax/with-ordinality-clause"}]},{"group":"Data types","pages":[{"title":"Overview of data types","sidebarTitle":"Overview","href":"/sql/data-types/overview"},{"title":"Casting","mode":"wide","href":"/sql/data-types/casting"},{"title":"Struct","href":"/sql/data-types/struct"},{"title":"ARRAY type","sidebarTitle":"Array","href":"/sql/data-types/array-type"},{"title":"Map type","sidebarTitle":"Map","href":"/sql/data-types/map-type"},{"title":"JSONB","href":"/sql/data-types/jsonb"},{"title":"VARIANT","href":"/sql/data-types/variant"},{"title":"rw_int256","href":"/sql/data-types/rw-int256"},{"title":"Vector data type","sidebarTitle":"Vector","href":"/sql/data-types/vector"},{"title":"Supported protobuf types","sidebarTitle":"Protobuf","href":"/sql/data-types/supported-protobuf-types"}]},{"group":"Functions and operators","pages":[{"title":"SQL functions and operators","sidebarTitle":"Overview","mode":"wide","href":"/sql/functions/overview"},{"title":"Logical operators","mode":"wide","href":"/sql/functions/logical"},{"title":"Comparison functions and operators","href":"/sql/functions/comparison"},{"title":"Mathematical functions and operators","href":"/sql/functions/mathematical"},{"title":"String functions and operators","href":"/sql/functions/string"},{"title":"Binary string functions and operators","href":"/sql/functions/binarystring"},{"title":"Date and time functions and operators","href":"/sql/functions/datetime"},{"title":"Cryptographic functions","href":"/sql/functions/cryptographic"},{"title":"JSON functions and operators","href":"/sql/functions/json"},{"title":"Array functions and operators","href":"/sql/functions/array"},{"title":"Map functions and operators","href":"/sql/functions/map"},{"title":"Conditional expressions","href":"/sql/functions/conditional"},{"title":"Aggregate functions","href":"/sql/functions/aggregate"},{"title":"Window functions","href":"/sql/functions/window-functions"},{"title":"Set-returning functions","href":"/sql/functions/set-returning"},{"title":"System administration functions","href":"/sql/functions/sys-admin"},{"title":"System information functions","href":"/sql/functions/sys-info"},{"title":"AI functions","href":"/sql/functions/ai"}]},{"title":"Identifiers","href":"/sql/identifiers"},{"group":"System catalogs","pages":[{"title":"System catalogs","sidebarTitle":"Overview","mode":"wide","href":"/sql/system-catalogs/overview"},{"title":"Information schema","href":"/sql/system-catalogs/information-schema"},{"title":"PostgreSQL catalogs","href":"/sql/system-catalogs/pg-catalog"},{"title":"RisingWave catalogs","href":"/sql/system-catalogs/rw-catalog"}]},{"title":"Psql commands","mode":"wide","href":"/sql/psql-commands"}]},{"group":"Python SDK","pages":[{"title":"Python SDK","href":"/sql/python-sdk/intro"}]},{"group":"User-defined functions","pages":[{"title":"User-defined functions","sidebarTitle":"Overview","href":"/sql/udfs/user-defined-functions"},{"group":"External UDFs","pages":[{"title":"External Python UDFs","sidebarTitle":"Python","href":"/sql/udfs/use-udfs-in-python"},{"title":"External Java UDFs","sidebarTitle":"Java","href":"/sql/udfs/use-udfs-in-java"}]},{"group":"Embedded UDFs","pages":[{"title":"Embedded Python UDFs","sidebarTitle":"Python","href":"/sql/udfs/embedded-python-udfs"},{"title":"Use UDFs in JavaScript","sidebarTitle":"JavaScript","href":"/sql/udfs/use-udfs-in-javascript"},{"title":"Use UDFs in Rust","sidebarTitle":"Rust","href":"/sql/udfs/use-udfs-in-rust"}]},{"title":"SQL UDFs","href":"/sql/udfs/sql-udfs"}]}]},{"tab":"Client Libraries","pages":[{"title":"Client Libraries","href":"/client-libraries/overview"}]},{"tab":"Web UI","pages":[{"title":"Web UI","href":"/web-ui/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/release-notes"}]}]}]},"title":"ALTER SCHEMA - RisingWave","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":[],"chunks":[]}