このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


一時期/支部 8. 接近 支配(する)/統制する

一時期/支部 8. 接近 支配(する)/統制する

Fred Toussi

The HSQL 開発 Group

$Revision: 3096 $

Copyright 2010-2024 Fred Toussi. 許可 is 認めるd to 分配する this 文書 without any alteration under the 条件 of the HSQLDB license. 付加 許可 is 認めるd to the HSQL 開発 Group to 分配する this 文書 with or without alterations under the 条件 of the HSQLDB license.

2024-10-25

(米)棚上げする/(英)提議する of Contents

Overview
Authorizations and 接近 支配(する)/統制する
Built-In 役割s and 使用者s
名簿(に載せる)/表(にあげる)ing 使用者s and 役割s
接近 権利s
Simple 接近 支配(する)/統制する
罰金-穀物d Data 接近 支配(する)/統制する
声明s for Authorization and 接近 支配(する)/統制する

Overview

This 一時期/支部 is about controlling 接近 to database 反対するs such as (米)棚上げする/(英)提議するs and 決まりきった仕事s. Other topics 関係のある to 安全 含む 使用者 authentication, password 複雑さ and 安全な・保証する 関係s. These topics are covered in the System 管理/経営 一時期/支部 and the HyperSQL 網状組織 Listeners (Servers) 一時期/支部.

Apart from schemas and their 反対する, each HyperSQL catalog has USER and ROLE 反対するs. These 反対するs are collectively called authorizations. Each AUTHORIZATION has some 接近 権利s on some of the schemas and the database 反対するs such as (米)棚上げする/(英)提議するs and 決まりきった仕事s 含む/封じ込めるd in those schemas. Only USER authorizations can be used to connect to the database and start a 開会/開廷/会期.

Authorization 指名するs are 蓄える/店d in the database in 事例/患者-normal form. When a 使用者 is created with the CREATE USER 声明, if the 使用者 指名する is enclosed in 二塁打 引用するs, the exact 指名する is used as the 事例/患者-normal form. But if it is not enclosed in 二塁打 引用するs, the 指名する is 変えるd to uppercase and this uppercase 見解/翻訳/版 is 蓄える/店d in the database as the 事例/患者-normal form. When connecting to a database 経由で JDBC, the 使用者 指名する and password must match the 事例/患者 of the 蓄える/店d form.

Each database has at least one admin 使用者. When the first 関係 to a 非,不,無-existent database is made, the admin 使用者 is created with the the 使用者 指名する for the 関係. The 使用者 指名する SA is 示唆するd in the documentation but you can use any 指名する.

Authorizations and 接近 支配(する)/統制する

In general, ROLE and USER 反対するs 簡単に 支配(する)/統制する 接近 to schema 反対するs. There is the built-in DBA 役割 that 許すs 十分な 接近 to all possible 操作/手術s on the database, 含むing the 創造 of USER and ROLE 反対するs and schemas. There are other built-in 役割s that 許す some special 操作/手術s on the database as a whole. Admin 使用者s have the DBA 役割.

A ROLE has a 指名する, a collection of 無 or more other 役割s, 加える some 特権s (接近 権利s). A USER has a 指名する and a password. It also has a collection of 無 or more 役割s 加える some 特権s.

USER 反対するs 存在するd in SQL-92, but ROLE 反対するs were introduced in SQL:1999. The co-存在 of ROLE and USER 反対するs results in 複雑さ. With the 新規加入 of ROLE 反対するs, there is no 合理的な/理性的な, other than 遺産/遺物 support, for 認めるing 特権s to USER 反対するs 直接/まっすぐに. It is better to create 役割s and 認める 特権s to them, then 認める the 役割s to USER 反対するs.

The 基準 効果的に defines a special ROLE, 指名するd PUBLIC. All authorizations have the PUBLIC 役割, which cannot be 除去するd from them. Therefore, any 接近 権利 割り当てるd to the PUBLIC 役割 適用するs to all authorizations in the database. For many simple databases, it is 適する to create one or more 非,不,無-admin 使用者s, then 割り当てる 接近 権利s to the (米)棚上げする/(英)提議するs and sequences to the PUBLIC 役割.

The PUBLIC 役割 is separate from the default PUBLIC schema. Like any 使用者-created schema, the contents of the PUBLIC schema are not 明白な to 非,不,無-admin 使用者s unless 接近 is 認めるd by the DBA 役割.

接近 to INFORMATION_SCHEMA 見解(をとる)s is automatically 認めるd to PUBLIC; therefore these 見解(をとる)s are accessible to all. However, the contents of each 見解(をとる) depend on the ROLE or USER (AUTHORIZATION) that is in 軍隊 while 接近ing the 見解(をとる). This means a 使用者 cannot even see the 存在 of (米)棚上げする/(英)提議するs and other 反対するs when it has no 接近 権利s on those 反対するs.

Each schema has a 選び出す/独身 AUTHORIZATION. This is 一般的に known as the owner of the schema. All the 反対するs in the schema 相続する the schema owner. The schema owner can 追加する 反対するs to the schema, 減少(する) them or alter them. By default, the 反対するs in a schema can only be 接近d by the schema owner. The schema owner can 認める 接近 権利s on the 反対するs to other 使用者s or 役割s.

authorization identifier

authorization identifier

<authorization identifier> ::= <役割 指名する> | <使用者 指名する>

Authorization identifiers 株 the same 指名する-space within the database. The same 指名する cannot be used for a USER and a ROLE.

Built-In 役割s and 使用者s

There are some pre-defined 役割s in each database; some defined by the SQL 基準, some by HyperSQL. These 役割s can be 割り当てるd to 使用者s (直接/まっすぐに or 経由で other, 使用者-defined 役割s). In 新規加入, there is the 初期の admin 使用者 created with each new database. The 初期の admin 使用者 指名する and password are defined in the 関係 所有物/資産/財産s when the first 関係 to the database is made. In older 見解/翻訳/版s of HSQLDB, this 指名する was always SA. But in the 最新の 見解/翻訳/版, the 指名する can be defined as a different string.

Admin 使用者

the Admin 使用者 (HyperSQL-明確な/細部)

This 使用者 is automatically created with a new database and has the DBA 役割. This 使用者 指名する and its password are defined in the 関係 所有物/資産/財産s when connecting to the new database to create the database. This 使用者 can change the password, create other 使用者s and create new schemas and other 反対するs. The 初期の admin 使用者 can be dropped by another 使用者 that has the DBA 役割. As a result, there is always at least one admin 使用者 in the database.

PUBLIC

the PUBLIC 役割

The 役割 that is 割り当てるd to all authorizations (役割s and 使用者s) in the database. This 役割 has 接近 権利s to all 反対するs in the INFORMATION_SCHEMA with 限られた/立憲的な visibility. Any 役割s or 権利s 認めるd to this 役割, are in 影響 認めるd to all 使用者s of the database.

_SYSTEM

the _SYSTEM 役割

This 役割 is the authorization for the pre-defined (system) 反対するs in the database, 含むing the INFORMATION_SCHEMA. This 役割 cannot be 割り当てるd to any authorization (使用者 or 役割).

DBA

the DBA 役割 (HyperSQL-明確な/細部)

This is a special 役割 in HyperSQL. A 使用者 that has this 役割 can 成し遂げる all possible 行政の 仕事s on the database. The DBA 役割 can also 行為/法令/行動する as a proxy for all the 役割s and 使用者s in the database. This means it can do everything the authorization for a schema can do, 含むing dropping the schema or its 反対するs, or 認めるing 権利s on the schema 反対するs to a grantee. All admin 使用者s have this 役割.

CREATE_SCHEMA

the CREATE_SCHEMA 役割 (HyperSQL-明確な/細部)

An authorization that has this 役割, can create schemas. The DBA authorization has this 役割 and can 認める it to other authorizations.

CHANGE_AUTHORIZATION

the CHANGE_AUTHORIZATION 役割 (HyperSQL-明確な/細部)

A 使用者 that has this 役割, can change the authorization for the 現在の 開会/開廷/会期 to another 使用者. The other 使用者 cannot have the DBA 役割 (さもなければ, the 初めの 使用者 would 伸び(る) DBA 特権s). The DBA authorization has this 役割 and can 認める it to other authorizations.

SCRIPT_OPS

the SCRIPT_OPS 役割 (HyperSQL-明確な/細部)

A 使用者 that has this 役割, can 遂行する/発効させる the PERFORM EXPORT SCRIPT and PERFORM IMPORT SCRIPT 声明s. The DBA authorization has this 役割 and can 認める it to other authorizations.

名簿(に載せる)/表(にあげる)ing 使用者s and 役割s

(米)棚上げする/(英)提議するs in the INFORMATION_SCHEMA 含む/封じ込める the 名簿(に載せる)/表(にあげる) of 使用者s and 役割s for the database. Only admin 使用者s can see the 十分な contents of these (米)棚上げする/(英)提議するs.

The SYSTEM_USERS (米)棚上げする/(英)提議するs 含む/封じ込めるs the 名簿(に載せる)/表(にあげる) of 使用者s, with some extra settings for each 使用者. The AUTHORIZATIONS (米)棚上げする/(英)提議する 含む/封じ込めるs a 名簿(に載せる)/表(にあげる) of both 使用者s and 役割s.

Several other INFORMATION_SCHEMA (米)棚上げする/(英)提議するs 名簿(に載せる)/表(にあげる) the 特権s 認めるd to 使用者s and 役割s on different database 反対するs. 言及する to the Schemas and Database 反対するs 一時期/支部 for a 名簿(に載せる)/表(にあげる) and description of the (米)棚上げする/(英)提議するs. Example below:

 SELECT * FROM INFORMATION_SCHEMA.SYSTEM_USERS
 SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES

接近 権利s

The create schema 声明s has an optional AUTHORIZATION 条項: For example:

 CREATE SCHEMA mySchema AUTHORIZATION aUserOrRole

If the authorization is not 明示するd, the DBA 役割 becomes the authorization. This authorization is the owner of the schema. By default, the 反対するs in a schema can only be 接近d by the schema owner. But the schema owner can 認める 特権s (接近 権利s) on the 反対するs to other 使用者s or 役割s.

Things can get far more コンビナート/複合体 because the 認める of 特権s can be made WITH GRANT OPTION. In this 事例/患者, the 役割 or 使用者 that has been 認めるd the 特権 can 認める the 特権 to other 役割s and 使用者s.

特権s can also be 取り消すd from 使用者s or 役割s.

The 声明s for 認めるing and 取り消すing 特権s 普通は 明示する which 特権s are 認めるd or 取り消すd. However, there is a shortcut, ALL PRIVILEGES, which means all the 特権s that the <grantor> has on the 明示するd schema 反対する. The <grantor> is 普通は the CURRENT_USER of the 開会/開廷/会期 that 問題/発行するs the 声明.

The 使用者 or 役割 that is 認めるd 特権s is referred to as <grantee> for the 認めるd 特権s.

TABLE

For (米)棚上げする/(英)提議するs, 含むing 見解(をとる)s, 特権s can be 認めるd with different degrees of granularity. It is possible to 認める a 特権 on all columns of a (米)棚上げする/(英)提議する, or on 明確な/細部 columns of the (米)棚上げする/(英)提議する.

The DELETE 特権 適用するs to the (米)棚上げする/(英)提議する, rather than its columns. It 適用するs to all DELETE 声明s.

The SELECT, INSERT and UPDATE 特権s may 適用する to all columns or to individual columns. These 特権s 決定する whether the <grantee> can 遂行する/発効させる SQL data 声明s on the (米)棚上げする/(英)提議する.

The SELECT 特権 指定するs the columns that can be 言及/関連d in SELECT 声明s, 同様に as the columns that are read in a DELETE or UPDATE 声明, 含むing the search 条件.

The INSERT 特権 指定するs the columns into which explicit values can be 挿入するd. To be able to 挿入する a 列/漕ぐ/騒動 into the (米)棚上げする/(英)提議する, the 使用者 must therefore have the INSERT 特権 on the (米)棚上げする/(英)提議する, or at least all the columns that do not have a default value.

The UPDATE 特権 指定するs the (米)棚上げする/(英)提議する or the 明確な/細部 columns that can be updated.

A MERGE 声明 要求するs SELECT 特権s together with INSERT, UPDATE and DELETE 特権s when these 活動/戦闘s are 明示するd in the 声明.

The REFERENCES 特権 許すs the <grantee> to define a FOREIGN KEY 強制 on a different (米)棚上げする/(英)提議する, which 言及/関連s the (米)棚上げする/(英)提議する or the 明確な/細部 columns 指定するd for the REFERENCES 特権.

The TRIGGER 特権 許すs 追加するing a 誘発する/引き起こす to the (米)棚上げする/(英)提議する.

SEQUENCE, TYPE, DOMAIN, CHARACTER SET, COLLATION, TRANSLITERATION

For these 反対するs, only USAGE can be 認めるd. The USAGE 特権 is needed when 反対する is 言及/関連d 直接/まっすぐに in an SQL 声明.

ROUTINE

For 決まりきった仕事s, 含むing 手続きs or 機能(する)/行事s, only EXECUTE 特権 can be 認めるd. This 特権 is needed when the 決まりきった仕事 is used 直接/まっすぐに in an SQL 声明.

OTHER OBJECTS

Other 反対するs such as 強制s and 主張s are not used 直接/まっすぐに and there is no grantable 特権 that 言及するs to them.

Simple 接近 支配(する)/統制する

The simplest form of 接近 支配(する)/統制する is when the DBA 使用者 creates a 選び出す/独身 非,不,無-admin 使用者, then creates the (米)棚上げする/(英)提議するs and other 反対するs in the PUBLIC schema, and 認めるs 接近 to the 反対するs to PUBLIC. A 認める to PUBLIC 適用するs to all 非,不,無-admin 使用者s, 含むing any 使用者s that are created later.

CREATE USER generalUser PASSWORD 'aPassword'

-- the 反対するs are created one by one in the PUBLIC schema 
SET SCHEMA PUBLIC
CREATE TABLE aTable ...
CREATE TABLE anotherTable ...
...
CREATE SEQUENCE aSequence ...
CREATE PROCECURE aProc ...
'''

-- 接近 権利s are 認めるd to PUBLIC, which 含むs the generalUser
GRANT ALL ON ALL TABLES IN SCHEMA public TO PUBLIC
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO PUBLIC
GRANT ALL ON ALL ROUTINES IN SCHEMA public TO PUBLIC

When different 使用者s need to have different levels of 接近, the 特権s are 認めるd to individual 使用者s as …に反対するd to PUBLIC. In the example below there are 2 使用者s with different 接近 権利s to the 反対するs in the schema.

-- two 使用者s are created first
CREATE USER generalUser PASSWORD 'aPassword'
CREATE USER auditUser PASSWORD 'anotherPassword'

-- the schema and its 反対するs are created with a 選び出す/独身 構内/化合物 声明 
CREATE SCHEMA mySchema AUTHORIZATION DBA
    CREATE TABLE aTable ...
    CREATE TABLE anotherTable ...
    ...
    CREATE SEQUENCE aSequence ...
    CREATE PROCECURE aProc ...
    ''';

-- different 接近 権利s are 認めるd to the 使用者s
GRANT ALL ON ALL TABLES IN SCHEMA mySchema TO generalUser
GRANT USAGE ON ALL SEQUENCES IN SCHEMA mySchema TO generalUser
GRANT EXECUTE ON ALL ROUTINES IN SCHEMA mySchema TO generalUser
GRANT SELECT ON ALL TABLES IN SCHEMA mySchema TO auditUser;

罰金-穀物d Data 接近 支配(する)/統制する

A USER or ROLE that does not own a schema can be 認めるd 接近 to individual columns of a (米)棚上げする/(英)提議する in the schema.

CREATE TABLE info(id INT PRIMARY KEY, (警察などへの)密告,告訴(状) VARCHAR(100), 地域 VARCHAR(32) NOT NULL, 満了する/死ぬs DATE NOT NULL)
CREATE ROLE eu_admin
CREATE ROLE eu_user
// the eu_admin can 挿入する, update and 削除する all 列/漕ぐ/騒動s 
GRANT ALL PRIVILEGES ON TABLE info TO eu_admin
// the eu_user cannot 削除する any 列/漕ぐ/騒動s
// the eu_user cannot see the contents of the 満了する/死ぬs columns
GRANT SELECT(id, (警察などへの)密告,告訴(状), 地域) ON TABLE info TO eu_user
// the eu_user can only update the contents of the (警察などへの)密告,告訴(状) column
GRANT UPDATE((警察などへの)密告,告訴(状)) ON TABLE info TO eu_user
GRANT eu_admin TO peter, wendy
GRANT eu_user TO emma, john

HyperSQL 追加するs a feature that is not part of the SQL 基準 to 許す 接近 to be 認めるd to a ROLE only for 確かな 列/漕ぐ/騒動s of a (米)棚上げする/(英)提議する, based on a FILTER 条件.

When the GRANT 声明 含む/封じ込めるs a FILTER 条件, the 条件 is 適用するd to each 列/漕ぐ/騒動 of the (米)棚上げする/(英)提議する that a SELECT, INSERT, UPDATE, DELETE or MERGE 声明 tries to 接近. Only the 列/漕ぐ/騒動s that 満足させる the 条件 are 接近d and all other 列/漕ぐ/騒動s are ignored.

The に引き続いて is an example of this usage. The (米)棚上げする/(英)提議する INFO has a column that 決定するs the geographic 地域 for each 列/漕ぐ/騒動 of data and another column that 持つ/拘留するs the 満期 date for this 列/漕ぐ/騒動. The owner of the schema can 接近 and change the data in all the 列/漕ぐ/騒動s of this (米)棚上げする/(英)提議する. A group of ordinary 使用者s with the eu_admin 役割 is only 許すd to 接近 the data for a 確かな 地域. Another group with the eu_user 役割 is only 許すd to 接近 the 列/漕ぐ/騒動s before the 満期 date.

CREATE TABLE info(id INT PRIMARY KEY, (警察などへの)密告,告訴(状) VARCHAR(100), 地域 VARCHAR(32) NOT NULL, 満了する/死ぬs DATE NOT NULL)
-- there is also a foreign 重要な 強制 on the REGION column to 言及/関連 a 名簿(に載せる)/表(にあげる) of valid 地域 指名するs.
INSERT INTO info VALUES 2, '挿入するd data for EU 現在の', 'European Union', CURRENT_DATE + 1 DAY
INSERT INTO info VALUES 3, '挿入するd data for SA 現在の', 'South America', CURRENT_DATE + 1 DAY
INSERT INTO info VALUES 4, '挿入するd data for EU 満了する/死ぬd', 'European Union', CURRENT_DATE - 1 DAY
CREATE ROLE eu_admin
CREATE ROLE eu_user
// the eu_admin cannot see the 列/漕ぐ/騒動s for 地域s other than the EU
GRANT SELECT FILTER (WHERE 地域 = 'European Union') ON TABLE info TO eu_admin
// the eu_user cannot see the 列/漕ぐ/騒動s past the 満了する/死ぬs date
GRANT SELECT FILTER (WHERE 地域 = 'European Union' AND 満了する/死ぬs > CURRENT_DATE) ON TABLE info TO eu_user
GRANT eu_admin TO peter, wendy
GRANT eu_user TO emma, john

In the above example, the EU_ADMIN and EU_USER 役割s are 認めるd to the 使用者s that are 許すd to 接近 the data for the European Union. These 使用者s cannot see the 列/漕ぐ/騒動s that are for other 地域s. の中で them, only the EU_ADMIN 使用者s can see the 列/漕ぐ/騒動s that have 満了する/死ぬd. The SELECT 認める with FILTER also 妨げるs the 使用者s from 削除するing or updating the 列/漕ぐ/騒動s they cannot 接近.

The <filter 条項> can be used for other forms of 罰金-穀物d 接近 支配(する)/統制する. In the example below, the COMMON_ROLE 役割 is defined and 認めるd 接近 during office hours only.

CREATE ROLE common_role
GRANT SELECT FILTER (WHERE EXTRACT(HOUR FROM CURRENT_TIMESTAMP) BETWEEN 9 AND 17) ON TABLE info TO common_role

罰金-穀物d data 接近 支配(する)/統制する can also be used to 器具/実施する multi-tenancy database 解答s.

A separate <filter 条項> can be 宣言するd on each of SELECT, DELETE, INSERT and UPDATE 権利s on the (米)棚上げする/(英)提議する. To change an 存在するing 罰金-穀物d 権利 認めるd to a ROLE on a (米)棚上げする/(英)提議する, the 存在するing 権利 must be 取り消すd before a GRANT with FILTER is made. Use of ALTER TABLE to 除去する columns that are not 言及/関連d in a FILTER 条件, or to 追加する new columns to the (米)棚上げする/(英)提議する, does not 影響する/感情 the 有効性,効力 of the FILTER 条件. But if any column that is 言及/関連d is 除去するd, you need to REVOKE the filtered 権利s.

With a MERGE 声明, which may 含む/封じ込める INSERT, UPDATE, and DELETE 条項s, the UPDATE filter is used when selecting the 列/漕ぐ/騒動s to UPDATE, 同様に as 列/漕ぐ/騒動s to DELETE.

声明s for Authorization and 接近 支配(する)/統制する

The 声明s 名簿(に載せる)/表(にあげる)d below 許す 創造 and 破壊 of USER and ROLE 反対するs. The GRANT and REVOKE 声明s 許す 役割s to be 割り当てるd to other 役割s or to 使用者s. The same 声明s are also used in a different form to 割り当てる 特権s on schema 反対するs to 使用者s and 役割s.

CREATE USER

使用者 鮮明度/定義 (HyperSQL)

<使用者 鮮明度/定義> ::= CREATE USER <使用者 指名する> PASSWORD <password> [ ADMIN ]

Define a new 使用者 and its password. <使用者 指名する> is an SQL identifier. If it is 二塁打-引用するd it is 事例/患者-極度の慎重さを要する, さもなければ it is turned to uppercase. <password> is a string enclosed with 選び出す/独身 引用する characters and is 事例/患者-極度の慎重さを要する. If ADMIN is 明示するd, the DBA 役割 is 認めるd to the new 使用者. Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 声明.

DROP USER

減少(する) 使用者 声明 (HyperSQL)

<減少(する) 使用者 声明> ::= DROP USER <使用者 指名する>

減少(する) (destroy) an 存在するing 使用者. If the 明示するd 使用者 is the authorization for a schema, the schema is destroyed.

Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 声明.

ALTER USER ... SET PASSWORD

始める,決める the password for a 使用者 (HyperSQL)

<alter 使用者 始める,決める password 声明> ::= ALTER USER <使用者 指名する> SET PASSWORD <password>

Change the password of an 存在するing 使用者. <使用者 指名する> is an SQL identifier. If it is 二塁打-引用するd it is 事例/患者-極度の慎重さを要する, さもなければ it is turned to uppercase. <password> is a string enclosed with 選び出す/独身 引用する characters and is 事例/患者-極度の慎重さを要する.

Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 命令(する).

ALTER USER ... SET INITIAL SCHEMA

始める,決める the 初期の schema for a 使用者 (HyperSQL)

<alter 使用者 始める,決める 初期の schema 声明> ::= ALTER USER <使用者 指名する> SET INITIAL SCHEMA <schema 指名する> | DEFAULT

Change the 初期の schema for a 使用者. The 初期の schema is the schema used by default for SQL 声明s 問題/発行するd during a 開会/開廷/会期. If DEFAULT is used, the default 初期の schema for all 使用者s is used as the 初期の schema for the 使用者. The SET SCHEMA 命令(する) 許すs the 使用者 to change the schema for the duration of the 開会/開廷/会期.

Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 声明.

ALTER USER ... SET LOCAL

始める,決める the 使用者 authentication as 地元の (HyperSQL)

<alter 使用者 始める,決める 地元の> ::= ALTER USER <使用者 指名する> SET LOCAL { TRUE | FALSE }

始める,決めるs the authentication method for the 使用者 as 地元の. This 声明 has an 影響 only when 外部の authentication with 役割 指名するs is enabled. In this method of authentication, 使用者s created in the database are ignored and an 外部の authentication 機械装置, such as LDAP is used. This 声明 is used if you want to use 地元の, password authentication for a 明確な/細部 使用者.

Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 声明.

SET PASSWORD

始める,決める password 声明 (HyperSQL)

<始める,決める password 声明> ::= SET PASSWORD <password>

始める,決める the password for the 現在の 使用者. <password> is a string enclosed with 選び出す/独身 引用する characters and is 事例/患者-極度の慎重さを要する.

SET INITIAL SCHEMA

始める,決める the 初期の schema for the 現在の 使用者 (HyperSQL)

<始める,決める 初期の schema 声明> ::= SET INITIAL SCHEMA <schema 指名する> | DEFAULT

Change the 初期の schema for the 現在の 使用者. The 初期の schema is the schema used by default for SQL 声明s 問題/発行するd during a 開会/開廷/会期. If DEFAULT is used, the default 初期の schema for all 使用者s is used as the 初期の schema for the 現在の 使用者. The separate SET SCHEMA 命令(する) 許すs the 使用者 to change the schema for the duration of the 開会/開廷/会期. See also the 開会/開廷/会期s and 処理/取引s 一時期/支部.

SET DATABASE DEFAULT INITIAL SCHEMA

始める,決める the default 初期の schema for all 使用者s (HyperSQL)

<始める,決める database default 初期の schema 声明> ::= SET DATABASE DEFAULT INITIAL SCHEMA <schema 指名する>

始める,決めるs the 初期の schema for new 使用者s. This schema can later be changed with the <始める,決める 初期の schema 声明> 命令(する).

CREATE ROLE

役割 鮮明度/定義

<役割 鮮明度/定義> ::= CREATE ROLE <役割 指名する> [ WITH ADMIN <grantor> ]

Defines a new 役割. 最初 the 役割 has no 権利s, except those of the PUBLIC 役割. Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 命令(する).

DROP ROLE

減少(する) 役割 声明

<減少(する) 役割 声明> ::= DROP ROLE <役割 指名する>

減少(する) (destroy) a 役割. If the 明示するd 役割 is the authorization for a schema, the schema is destroyed. Only a 使用者 with the DBA 役割 can 遂行する/発効させる this 声明.

GRANTED BY

grantor 決意

GRANTED BY <grantor>

<grantor> ::= CURRENT_USER | CURRENT_ROLE

The authorization that is 認めるing or 取り消すing a 役割 or 特権s. The optional GRANTED BY <grantor> 条項 can be used in さまざまな 声明s that 成し遂げる GRANT or REVOKE 活動/戦闘s. If the 条項 is not used, the authorization is CURRENT_USER. さもなければ, it is the 明示するd authorization.

GRANT

認める 特権 声明

<認める 特権 声明> ::= GRANT <特権s> TO <grantee> [ { <comma> <grantee> }... ] [ WITH GRANT OPTION ] [ GRANTED BY <grantor> ]

割り当てる 特権s on schema 反対するs to 役割s or 使用者s. Each <grantee> is a 役割 or a 使用者. If [ WITH GRANT OPTION ] is 明示するd, then the <grantee> can 割り当てる the 特権s to other <grantee> 反対するs.

<特権s> ::= <反対する 特権s> ON <反対する 指名する> [ <filter 条項> ]

<反対する 特権s> ::= ALL PRIVILEGES | <活動/戦闘> [ <filter 条項> ] [ { <comma> <活動/戦闘> }... ]

<活動/戦闘> ::= SELECT [ <left paren> <特権 column 名簿(に載せる)/表(にあげる)> <権利 paren> ] | DELETE | INSERT [ <left paren> <特権 column 名簿(に載せる)/表(にあげる)> <権利 paren> ] | UPDATE [ <left paren> <特権 column 名簿(に載せる)/表(にあげる)> <権利 paren> ] | REFERENCES [ <left paren> <特権 column 名簿(に載せる)/表(にあげる)> <権利 paren> ] | TRIGGER | USAGE | EXECUTE

<反対する 指名する> ::= { <選び出す/独身 反対する 指名する> | <schema 反対する 始める,決める 指名する> }

<simple 反対する 指名する> ::= [ TABLE ] <(米)棚上げする/(英)提議する 指名する> | DOMAIN <domain 指名する> | COLLATION <collation 指名する> | CHARACTER SET <character 始める,決める 指名する> | TRANSLATION <transliteration 指名する> | TYPE <使用者-defined type 指名する> | SEQUENCE <sequence 発生させる人(物) 指名する> | <明確な/細部 決まりきった仕事 designator> | ROUTINE <決まりきった仕事 指名する> | FUNCTION <機能(する)/行事 指名する> | PROCEDURE <手続き 指名する>

<schema 反対する 始める,決める 指名する> ::= ALL { TABLES | SEQUENCES | ROUTINES } IN SCHEMA <schema 指名する>

<特権 column 名簿(に載せる)/表(にあげる)> ::= <column 指名する 名簿(に載せる)/表(にあげる)>

<filter 条項> ::= FILTER <left paren> WHERE <search 条件> <権利 paren>

<grantee> ::= PUBLIC | <authorization identifier>

The <反対する 特権s> that can be used depend on the type of the <反対する 指名する>. These are discussed in the previous section. For a (米)棚上げする/(英)提議する or 見解(をとる), if <特権 column 名簿(に載せる)/表(にあげる)> is not 明示するd, then the 特権 is 認めるd on the (米)棚上げする/(英)提議する, which 含むs all of its columns and any column that may be 追加するd to it in the 未来.

For 決まりきった仕事s, the 指名する of the 決まりきった仕事 can be 明示するd in two ways, either as the generic 指名する, or as the 明確な/細部 指名する for a 署名. HyperSQL 許すs 言及/関連ing the generic 指名する which covers all 積みすぎる 見解/翻訳/版s of a 決まりきった仕事 at the same time. This is an 拡張 to the SQL 基準, which 要求するs the use of <明確な/細部 決まりきった仕事 designator> to 認める 特権s 分かれて on each different 署名 of the 決まりきった仕事.

HyperSQL also 追加するs the <schema 反対する 始める,決める 指名する> 選択 as an 拡張 to the SQL 基準. This form 認めるs the 特権s to all the (米)棚上げする/(英)提議するs of the schema with a 選び出す/独身 GRANT 声明.

The <filter 条項> can be 明示するd after the <反対する 指名する> to 限界 接近 for all the 認めるd 特権s, or it can be used after individual 特権s.

Each <grantee> is the 指名する of a 役割 or a 使用者. Examples of GRANT 声明 are given below:

 GRANT ALL ON SEQUENCE aSequence TO roleOrUser 
 GRANT SELECT ON aTable TO roleOrUser
 GRANT SELECT(col3, col5) ON aTable TO aRole  
 GRANT SELECT, UPDATE FILTER(WHERE aColumn > 2) ON aTABLE TO role1 -- filter only for update
 GRANT SELECT, UPDATE ON aTable FILTER(WHERE aColumn > 2) TO role2 -- filter for both select and update
 GRANT SELECT(columnA, columnB), UPDATE(columnA, columnB) ON TABLE aTable TO user1, role1, role2
 GRANT EXECUTE ON SPECIFIC ROUTINE aroutine_1234 TO roleOrUser
 GRANT SELECT ON ALL TABLES IN SCHEMA mySchema TO PUBLIC

As について言及するd in the general discussion, it is better to define a 役割 for a collection of all the 特権s 要求するd by an 使用/適用. This 役割 is then 認めるd to any 使用者. If その上の changes are made to the 特権s of this 役割, they are automatically 反映するd in all the 使用者s that have the 役割. 罰金-穀物d 特権s (those with a FILTER 条項) can be 認めるd to 役割s only.

GRANT

認める 役割 声明

<認める 役割 声明> ::= GRANT <役割 指名する> [ { <comma> <役割 指名する> }... ] TO <grantee> [ { <comma> <grantee> }... ] [ WITH ADMIN OPTION ] [ GRANTED BY <grantor> ]

割り当てる 役割s to 役割s or 使用者s. One or more 役割s can be 割り当てるd to one or more <grantee> 反対するs. A <grantee> is a 使用者 or a 役割. If the [ WITH ADMIN OPTION ] is 明示するd, then each <grantee> can 認める the newly 割り当てるd 役割s to other grantees. An example of 使用者 and 役割 創造 with 認めるs is given below:

 CREATE USER appuser
 CREATE ROLE approle
 GRANT approle TO appuser
 GRANT SELECT, UPDATE ON TABLE atable TO approle
 GRANT USAGE ON SEQUENCE asequence to approle
 GRANT EXECUTE ON ROUTINE aroutine TO approle

REVOKE 特権

取り消す 声明

<取り消す 特権 声明> ::= REVOKE [ GRANT OPTION FOR ] <特権s> FROM <grantee> [ { <comma> <grantee> }... ] [ GRANTED BY <grantor> ] RESTRICT | CASCADE

取り消す 特権s from a 使用者 or 役割. The syntax elements are 類似の to the GRANT 声明s.

REVOKE 役割

取り消す 役割 声明

<取り消す 役割 声明> ::= REVOKE [ ADMIN OPTION FOR ] <役割 取り消すd> [ { <comma> <役割 取り消すd> }... ] FROM <grantee> [ { <comma> <grantee> }... ] [ GRANTED BY <grantor> ] RESTRICT | CASCADE

<役割 取り消すd> ::= <役割 指名する>

取り消す a 役割 from 使用者s or 役割s.


$Revision: 6787 $