自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CREATE SCHEMA 中文man頁(yè)面

系統(tǒng)
CREATE SCHEMA 將在當(dāng)前數(shù)據(jù)庫(kù)里輸入一個(gè)新的模式。 該模式名將在當(dāng)前數(shù)據(jù)庫(kù)里現(xiàn)存的所有模式名中唯一。

NAME

CREATE SCHEMA - 定義一個(gè)新的模式

SYNOPSIS

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

DESCRIPTION 描述

CREATE SCHEMA 將在當(dāng)前數(shù)據(jù)庫(kù)里輸入一個(gè)新的模式。 該模式名將在當(dāng)前數(shù)據(jù)庫(kù)里現(xiàn)存的所有模式名中唯一。


 模式實(shí)際上是一個(gè)名字空間: 它包含命名對(duì)象(表,數(shù)據(jù)類型,函數(shù)和操作符)這些名字可以和其它模式里存在的其它對(duì)象重名。 命名對(duì)象要么是通過(guò)用模式名作為前綴"修飾"這些它們的名字進(jìn)行訪問(wèn), 要么是通過(guò)設(shè)置一個(gè)搜索路徑包含所需要的模式。 無(wú)修飾的對(duì)象都是在當(dāng)前模式中創(chuàng)建的(在搜索路徑最前面的;可以用函數(shù) current_schema 來(lái)判斷)。


 另外,CREATE SCHEMA 可以包括在新模式中創(chuàng)建對(duì)象的子命令。 這些子命令和那些在創(chuàng)建完模式后發(fā)出的命令沒(méi)有任何區(qū)別,只不過(guò)是如果使用了 AUTHORIZATION 子句, 那么所有創(chuàng)建的對(duì)象都將被該用戶擁有。  

PARAMETERS 參數(shù)

schemaname

 要?jiǎng)?chuàng)建的模式名字。如果省略,則使用用戶名作為模式名。
username

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

 一個(gè) SQL 語(yǔ)句,定義一個(gè)要在模式里創(chuàng)建的對(duì)象。 目前,只有 CREATE TABLE,CREATE VIEW, 和 GRANT 是在 CREATE SCHEMA 里面可以接受的子句。 其它類型的對(duì)象可以在創(chuàng)建完模式之后的獨(dú)立的命令里創(chuàng)建。

NOTES 注意


 要?jiǎng)?chuàng)建模式,調(diào)用該命令的用戶必需在當(dāng)前數(shù)據(jù)庫(kù)上有 CREATE 權(quán)限。(當(dāng)然,超級(jí)用戶繞開(kāi)這個(gè)檢查。)  

EXAMPLES 例子


 創(chuàng)建一個(gè)模式:

CREATE SCHEMA myschema;


 為用戶 joe 創(chuàng)建模式 --- 模式也會(huì)叫 joe:

CREATE SCHEMA AUTHORIZATION joe;


 創(chuàng)建一個(gè)模式并且在里面創(chuàng)建一個(gè)表:

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;


 請(qǐng)注意上面的獨(dú)立的子命令不是由分號(hào)結(jié)尾的。


 下面的命令是實(shí)現(xiàn)同樣結(jié)果的等效語(yǔ)句:

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 標(biāo)準(zhǔn)允許在 CREATE SCHEMA 里面有一個(gè) DEFAULT CHARACTER SET 子句,以及比目前 PostgreSQL 可以接受的更多的子命令。


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


 在 SQL 標(biāo)準(zhǔn)里,模式的所有者總是擁有其中的所有對(duì)象。 PostgreSQL 允許模式包含非模式所有者所有的對(duì)象。 只有在模式所有者 CREATE 了自己的模式的權(quán)限給了其它人才可能出現(xiàn)。  

SEE ALSO 參見(jiàn)

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)]

責(zé)任編輯:韓亞珊 來(lái)源: CMPP.net
相關(guān)推薦

2011-08-24 13:43:09

CREATE USER中文man

2011-08-24 13:46:39

CREATE VIEW中文man

2011-08-24 13:29:20

CREATE TABL中文man

2011-08-24 13:36:25

CREATE TRIG中文man

2011-08-24 10:56:32

CREATE CONV中文man

2011-08-24 10:46:36

CREATE AGGR中文man

2011-08-24 11:15:24

CREATE INDE中文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 13:26:19

CREATE SEQU中文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 11:05:36

CREATE FUNC中文man

2011-08-24 13:39:44

CREATE TYPE中文man

2011-08-24 11:10:17

CREATE GROU中文man

2011-08-24 14:43:21

drop_schema中文man

2011-08-24 09:39:10

alter_schem中文man

2011-08-25 14:07:55

create_modu中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)