diff --git a/v20.2/alter-schema.md b/v20.2/alter-schema.md index 084a52f7b0e..619eca955d9 100644 --- a/v20.2/alter-schema.md +++ b/v20.2/alter-schema.md @@ -17,8 +17,8 @@ ALTER SCHEMA ... OWNER TO { | CURRENT_USER | SESSION_USER } Parameter | Description ----------|------------ -`RENAME TO ...` | Rename the schema. -`OWNER TO ...` | Change the owner of the schema. You can specify the new owner with a string literal or the [`CURRENT_USER` or `SESSION_USER` keywords](functions-and-operators.html#special-syntax-forms). +`RENAME TO ...` | Rename the schema. The new schema name must be unique within its database and follow these [identifier rules](keywords-and-identifiers.html#identifiers). When the parent database is not set as the default, the name must be formatted as `database.name`. +`OWNER TO ...` | Change the owner of the schema. You can specify the new owner with a [string literal](https://en.wikipedia.org/wiki/String_literal) or the [`CURRENT_USER` or `SESSION_USER` keywords](functions-and-operators.html#special-syntax-forms). ## Required privileges @@ -120,7 +120,7 @@ WHERE (1 row) ~~~ -Rename the schema as its owner: +As its owner, you can rename the schema: {% include copy-clipboard.html %} ~~~ sql diff --git a/v20.2/create-schema.md b/v20.2/create-schema.md index 49cb76ec581..3957860e604 100644 --- a/v20.2/create-schema.md +++ b/v20.2/create-schema.md @@ -22,7 +22,7 @@ Parameter | Description ----------|------------ `IF NOT EXISTS` | Create a new schema only if a schema of the same name does not already exist. If one does exist, do not return an error. `schemaname` | The name of the schema to create, which must be unique and follow these [identifier rules](keywords-and-identifiers.html#identifiers). -`AUTHORIZATION ...` | Optionally identify a user to be the owner of the schema. You can specify the owner with a string literal, or the [`CURRENT_USER` or `SESSION_USER` keywords](functions-and-operators.html#special-syntax-forms).

If a `CREATE SCHEMA` statement has an `AUTHORIZATION` clause, but no `schemaname`, the schema will be named after the specified owner of the schema. If a `CREATE SCHEMA` statement does not have an `AUTHORIZATION` clause, the user executing the statement will be named the owner. +`AUTHORIZATION ...` | Optionally identify a user to be the owner of the schema. You can specify the owner with a [string literal](https://en.wikipedia.org/wiki/String_literal), or the [`CURRENT_USER` or `SESSION_USER` keywords](functions-and-operators.html#special-syntax-forms).

If a `CREATE SCHEMA` statement has an `AUTHORIZATION` clause, but no `schemaname`, the schema will be named after the specified owner of the schema. If a `CREATE SCHEMA` statement does not have an `AUTHORIZATION` clause, the user executing the statement will be named the owner. ## Example @@ -272,7 +272,7 @@ $ cockroach sql --url 'postgres://max:roach@host:port/db?sslmode=require' (2 rows) ~~~ -`max` then inserts some values into the `accounts` table, without specifying a schema. +`max` then inserts some values into the `accounts` table, without specifying a schema: {% include copy-clipboard.html %} ~~~ sql