成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

CREATE SCHEMA 中文man頁面

系統
CREATE SCHEMA 將在當前數據庫里輸入一個新的模式。 該模式名將在當前數據庫里現存的所有模式名中唯一。

NAME

CREATE SCHEMA - 定義一個新的模式

SYNOPSIS

CREATE SCHEMA schemaname [ AUTHORIZATION username ] [ schema_element [ ... ] ]
CREATE SCHEMA AUTHORIZATION username [ schema_element [ ... ] ]

DESCRIPTION 描述

CREATE SCHEMA 將在當前數據庫里輸入一個新的模式。 該模式名將在當前數據庫里現存的所有模式名中唯一。


 模式實際上是一個名字空間: 它包含命名對象(表,數據類型,函數和操作符)這些名字可以和其它模式里存在的其它對象重名。 命名對象要么是通過用模式名作為前綴"修飾"這些它們的名字進行訪問, 要么是通過設置一個搜索路徑包含所需要的模式。 無修飾的對象都是在當前模式中創建的(在搜索路徑最前面的;可以用函數 current_schema 來判斷)。


 另外,CREATE SCHEMA 可以包括在新模式中創建對象的子命令。 這些子命令和那些在創建完模式后發出的命令沒有任何區別,只不過是如果使用了 AUTHORIZATION 子句, 那么所有創建的對象都將被該用戶擁有。  

PARAMETERS 參數

schemaname

 要創建的模式名字。如果省略,則使用用戶名作為模式名。
username

 將擁有該模式的用戶名。如果省略,缺省為執行該命令的用戶名。 只有超級用戶才能創建不屬于自己的模式。
schema_element

 一個 SQL 語句,定義一個要在模式里創建的對象。 目前,只有 CREATE TABLE,CREATE VIEW, 和 GRANT 是在 CREATE SCHEMA 里面可以接受的子句。 其它類型的對象可以在創建完模式之后的獨立的命令里創建。

NOTES 注意


 要創建模式,調用該命令的用戶必需在當前數據庫上有 CREATE 權限。(當然,超級用戶繞開這個檢查。)  

EXAMPLES 例子


 創建一個模式:

CREATE SCHEMA myschema;


 為用戶 joe 創建模式 --- 模式也會叫 joe:

CREATE SCHEMA AUTHORIZATION joe;


 創建一個模式并且在里面創建一個表:

CREATE SCHEMA hollywood
    CREATE TABLE films (title text, release date, awards text[])
    CREATE VIEW winners AS
        SELECT title, release FROM films WHERE awards IS NOT NULL;


 請注意上面的獨立的子命令不是由分號結尾的。


 下面的命令是實現同樣結果的等效語句:

CREATE SCHEMA hollywood;
CREATE TABLE hollywood.films (title text, release date, awards text[]);
CREATE VIEW hollywood.winners AS
    SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;

COMPATIBILITY 兼容性


 SQL 標準允許在 CREATE SCHEMA 里面有一個 DEFAULT CHARACTER SET 子句,以及比目前 PostgreSQL 可以接受的更多的子命令。


 SQL 標準聲明在 CREATE SCHEMA 里的子命令可以以任意順序出現。 目前 PostgreSQL  里的實現還不能處理所有子命令里需要提前引用的情況;有時候可能需要重排一下子命令的順序以避免前向引用。


 在 SQL 標準里,模式的所有者總是擁有其中的所有對象。 PostgreSQL 允許模式包含非模式所有者所有的對象。 只有在模式所有者 CREATE 了自己的模式的權限給了其它人才可能出現。  

SEE ALSO 參見

ALTER SCHEMA [alter_schema(7)], DROP SCHEMA [drop_schema(l)]  

#p#

NAME

CREATE SCHEMA - define a new schema

SYNOPSIS

CREATE SCHEMA schemaname [ AUTHORIZATION username ] [ schema_element [ ... ] ]
CREATE SCHEMA AUTHORIZATION username [ schema_element [ ... ] ]

DESCRIPTION

CREATE SCHEMA will enter a new schema into the current database. The schema name must be distinct from the name of any existing schema in the current database.

A schema is essentially a namespace: it contains named objects (tables, data types, functions, and operators) whose names may duplicate those of other objects existing in other schemas. Named objects are accessed either by ``qualifying'' their names with the schema name as a prefix, or by setting a search path that includes the desired schema(s). Unqualified objects are created in the current schema (the one at the front of the search path, which can be determined with the function current_schema).

Optionally, CREATE SCHEMA can include subcommands to create objects within the new schema. The subcommands are treated essentially the same as separate commands issued after creating the schema, except that if the AUTHORIZATION clause is used, all the created objects will be owned by that user.  

PARAMETERS

schemaname
The name of a schema to be created. If this is omitted, the user name is used as the schema name.
username
The name of the user who will own the schema. If omitted, defaults to the user executing the command. Only superusers may create schemas owned by users other than themselves.
schema_element
An SQL statement defining an object to be created within the schema. Currently, only CREATE TABLE, CREATE VIEW, and GRANT are accepted as clauses within CREATE SCHEMA. Other kinds of objects may be created in separate commands after the schema is created.

NOTES

To create a schema, the invoking user must have CREATE privilege for the current database. (Of course, superusers bypass this check.)  

EXAMPLES

Create a schema:

CREATE SCHEMA myschema;

Create a schema for user joe; the schema will also be named joe:

CREATE SCHEMA AUTHORIZATION joe;

Create a schema and create a table and view within it:

CREATE SCHEMA hollywood
    CREATE TABLE films (title text, release date, awards text[])
    CREATE VIEW winners AS
        SELECT title, release FROM films WHERE awards IS NOT NULL;

Notice that the individual subcommands do not end with semicolons.

The following is an equivalent way of accomplishing the same result:

CREATE SCHEMA hollywood;
CREATE TABLE hollywood.films (title text, release date, awards text[]);
CREATE VIEW hollywood.winners AS
    SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;

COMPATIBILITY

The SQL standard allows a DEFAULT CHARACTER SET clause in CREATE SCHEMA, as well as more subcommand types than are presently accepted by PostgreSQL.

The SQL standard specifies that the subcommands in CREATE SCHEMA may appear in any order. The present PostgreSQL implementation does not handle all cases of forward references in subcommands; it may sometimes be necessary to reorder the subcommands to avoid forward references.

According to the SQL standard, the owner of a schema always owns all objects within it. PostgreSQL allows schemas to contain objects owned by users other than the schema owner. This can happen only if the schema owner grants the CREATE privilege on his schema to someone else.  

SEE ALSO

ALTER SCHEMA [alter_schema(7)], DROP SCHEMA [drop_schema(l)]

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-24 10:46:36

CREATE AGGR中文man

2011-08-24 10:56:32

CREATE CONV中文man

2011-08-24 11:15:24

CREATE INDE中文man

2011-08-24 13:29:20

CREATE TABL中文man

2011-08-24 13:36:25

CREATE TRIG中文man

2011-08-24 13:43:09

CREATE USER中文man

2011-08-24 13:46:39

CREATE VIEW中文man

2011-08-24 13:32:56

CREATE TABL中文man

2011-08-24 10:59:19

CREATE DATA中文man

2011-08-24 11:02:11

CREATE DOMA中文man

2011-08-24 11:05:36

CREATE FUNC中文man

2011-08-24 11:10:17

CREATE GROU中文man

2011-08-24 11:18:53

CREATE LANG中文man

2011-08-24 11:23:20

CREATE OPER中文man

2011-08-24 11:31:47

CREATE RULE中文man

2011-08-24 13:26:19

CREATE SEQU中文man

2011-08-24 13:39:44

CREATE TYPE中文man

2011-08-24 14:43:21

drop_schema中文man

2011-08-24 10:53:20

CREATE CONS中文man

2011-08-24 11:26:46

CREATE OPER中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产精品一区二区三级 | 亚洲三级在线观看 | 亚洲成人精品一区二区 | 免费一看一级毛片 | 精品福利一区二区三区 | 色综合久久天天综合网 | 色综合久久久 | 在线观看欧美日韩视频 | 中文字幕电影在线观看 | 日本三级全黄三级三级三级口周 | 国产精品中文字幕在线 | 麻豆久久久久久 | 国产毛片毛片 | 亚洲国产精品一区二区三区 | 韩国精品在线观看 | 中文字幕一区在线观看视频 | 久久男人| 欧美男人天堂 | 天天看天天操 | 亚洲欧美一区在线 | 国产一区二区三区免费 | 亚洲精品中文字幕 | av电影一区二区 | 久久毛片| 中文字幕高清一区 | 精品一二三区在线观看 | 91成人免费观看 | 一级黄片一级毛片 | 国户精品久久久久久久久久久不卡 | 天堂免费看片 | 国产欧美精品在线 | 午夜av影院| 久草视频在线播放 | 91精品一区二区三区久久久久久 | 国产人成在线观看 | 91精品久久久久久久久 | 日韩精品视频在线观看一区二区三区 | 91九色在线观看 | 久久国产电影 | 日韩手机在线看片 | 亚洲一区二区三区视频免费观看 |