forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
181 lines
43 KiB
HTML
181 lines
43 KiB
HTML
<a name="EN-US_TOPIC_0000001188429106"></a><a name="EN-US_TOPIC_0000001188429106"></a>
|
|
|
|
<h1 class="topictitle1">CREATE USER</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188429106__s5b655354cc4a468996b5ea5ccf96eef1"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188429106__p11128134817614"><strong id="EN-US_TOPIC_0000001188429106__b147693362328">CREATE USER</strong> creates a user.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429106__sd16eb48466c14a57894886ee710120db"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188429106__ul139412062717"><li id="EN-US_TOPIC_0000001188429106__li158017715272">A user created using the <strong id="EN-US_TOPIC_0000001188429106__b1953864015326">CREATE USER</strong> statement has the <strong id="EN-US_TOPIC_0000001188429106__b185431407323">LOGIN</strong> permission by default.</li><li id="EN-US_TOPIC_0000001188429106__li1618551411277">A schema named after the user is automatically created in the database where the statement is executed, but not in other databases. You can run the <strong id="EN-US_TOPIC_0000001188429106__b104031243113216">CREATE SCHEMA</strong> statement to create such a schema for the user in other databases.</li><li id="EN-US_TOPIC_0000001188429106__li14941206273">The owner of an object created by a system administrator in a schema with the same name as a common user is the common user, not the system administrator.</li><li id="EN-US_TOPIC_0000001188429106__li204701769168">Users other than system administrators cannot create objects in a schema named after a user, unless the users are granted with the role permissions of that schema. For details, see <strong id="EN-US_TOPIC_0000001188429106__b17200418144014">After the all Permission Is Granted to the Schema of a User, the Error Message "ERROR: current user does not have privilege to role tom" Persists During Table Creation</strong> in <em id="EN-US_TOPIC_0000001188429106__i53954716418">Troubleshooting</em>.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429106__sab6d6871adc14e79b0b3aeb1dc09527a"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__s6e38b11115cb4b51bdd562fc1d2be8c4"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">user_name</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">option</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">ENCRYPTED</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">UNENCRYPTED</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="s1">'password'</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">DISABLE</span><span class="w"> </span><span class="err">}</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429106__a08c057935829473396f08d21d4bfe389">The <strong id="EN-US_TOPIC_0000001188429106__b81776492323">option</strong> clause is used for setting information including permissions and attributes.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__s6f43fedf8f614913a96102537e10a6ae"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span>
|
|
<span class="normal">11</span>
|
|
<span class="normal">12</span>
|
|
<span class="normal">13</span>
|
|
<span class="normal">14</span>
|
|
<span class="normal">15</span>
|
|
<span class="normal">16</span>
|
|
<span class="normal">17</span>
|
|
<span class="normal">18</span>
|
|
<span class="normal">19</span>
|
|
<span class="normal">20</span>
|
|
<span class="normal">21</span>
|
|
<span class="normal">22</span>
|
|
<span class="normal">23</span>
|
|
<span class="normal">24</span>
|
|
<span class="normal">25</span>
|
|
<span class="normal">26</span>
|
|
<span class="normal">27</span>
|
|
<span class="normal">28</span>
|
|
<span class="normal">29</span>
|
|
<span class="normal">30</span>
|
|
<span class="normal">31</span></pre></div></td><td class="code"><div><pre><span></span><span class="err">{</span><span class="n">SYSADMIN</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOSYSADMIN</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">AUDITADMIN</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOAUDITADMIN</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="k">CREATEDB</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">NOCREATEDB</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">USEFT</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOUSEFT</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">CREATEROLE</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOCREATEROLE</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">INHERIT</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOINHERIT</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">LOGIN</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOLOGIN</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">REPLICATION</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOREPLICATION</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">INDEPENDENT</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOINDEPENDENT</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="err">{</span><span class="n">VCADMIN</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NOVCADMIN</span><span class="err">}</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">CONNECTION</span><span class="w"> </span><span class="k">LIMIT</span><span class="w"> </span><span class="n">connlimit</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">BEGIN</span><span class="w"> </span><span class="s1">'timestamp'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">UNTIL</span><span class="w"> </span><span class="s1">'timestamp'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">RESOURCE</span><span class="w"> </span><span class="n">POOL</span><span class="w"> </span><span class="s1">'respool'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="s1">'groupuser'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">PERM</span><span class="w"> </span><span class="k">SPACE</span><span class="w"> </span><span class="s1">'spacelimit'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">TEMP</span><span class="w"> </span><span class="k">SPACE</span><span class="w"> </span><span class="s1">'tmpspacelimit'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">SPILL</span><span class="w"> </span><span class="k">SPACE</span><span class="w"> </span><span class="s1">'spillspacelimit'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NODE</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="n">logic_cluster_name</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">role_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="n">role_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">ROLE</span><span class="w"> </span><span class="n">role_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">ADMIN</span><span class="w"> </span><span class="n">role_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">role_name</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">SYSID</span><span class="w"> </span><span class="n">uid</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">DEFAULT</span><span class="w"> </span><span class="n">TABLESPACE</span><span class="w"> </span><span class="n">tablespace_name</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">PROFILE</span><span class="w"> </span><span class="k">DEFAULT</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">PROFILE</span><span class="w"> </span><span class="n">profile_name</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">PGUSER</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">AUTHINFO</span><span class="w"> </span><span class="s1">'authinfo'</span>
|
|
<span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="n">EXPIRATION</span><span class="w"> </span><span class="k">period</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429106__s17ea4f8187d34bb0966d2930fbe26d38"><h4 class="sectiontitle">Parameters</h4><ul id="EN-US_TOPIC_0000001188429106__u83d8d8474d9d484dbeb66e30ef5074ad"><li id="EN-US_TOPIC_0000001188429106__le1db8114e75c46f68824d59e6eacf1f3"><strong id="EN-US_TOPIC_0000001188429106__aa0b1225700114f9d899c964b8b92d72d">user_name</strong><p id="EN-US_TOPIC_0000001188429106__aaf0a6a41636c49218442abe52c8b8600">Specifies the user name.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a8f278f7d919a4728ae8f52b8ff3c6609">Value range: a string. It must comply with the naming convention. A value can contain a maximum of 63 characters.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l9c697479b1424f259d6122229643f327"><strong id="EN-US_TOPIC_0000001188429106__ac238ff79ddcb4905b22f84108f96eaf0">password</strong><p id="EN-US_TOPIC_0000001188429106__af70d9cb3f254409f957f3a89f58b7c3b">Specifies the login password.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__ac9b0549b9cc34b7cb15727442d9dc2e9">A password must:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429106__u8ac05cbd57c444a18122393278e4b96f"><li id="EN-US_TOPIC_0000001188429106__l8ff69750134c4923ac982bd19b9f132e">Contain at least eight characters. This is the default length.</li><li id="EN-US_TOPIC_0000001188429106__l3e07b147ec75494bb5df1112267edce6">Differ from the user name or the user name spelled backwards.</li><li id="EN-US_TOPIC_0000001188429106__l61f7b51a2cc842e9a35f9feb5e7ca5dd">Contains at least three of the following four character types: uppercase letters, lowercase letters, digits, and special characters, including: ~!@#$%^&*()-_=+\|[{}];:,<.>/?. If you use characters other than the four types, a warning is displayed, but you can still create the password.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001188429106__a5a334a9a4e9840b7ade17fe87023af08">Value range: a string</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li148071938164319"><strong id="EN-US_TOPIC_0000001188429106__b102401014111114">DISABLE</strong><p id="EN-US_TOPIC_0000001188429106__p990311347575">By default, you can change your password unless it is disabled. Use this parameter to disable the password of a user. After the password of a user is disabled, the password will be deleted from the system. The user can connect to the database only through external authentication, for example, IAM authentication, Kerberos authentication, or LDAP authentication. Only administrators can enable or disable a password. Common users cannot disable the password of an initial user. To enable a password, run <strong id="EN-US_TOPIC_0000001188429106__b185949671112529">ALTER USER</strong> and specify the password.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__la1159b3b373a4174bba7853f3ef2b3ae"><strong id="EN-US_TOPIC_0000001188429106__a98194cd205ca43f99adc84ebfe88ee2a">ENCRYPTED | UNENCRYPTED</strong><p id="EN-US_TOPIC_0000001188429106__af68e12bdbcd04136b30c9065d39074ec">Determines whether the password stored in the system will be encrypted. (If neither is specified, the password status is determined by <strong id="EN-US_TOPIC_0000001188429106__b2027406108112529">password_encryption_type</strong>.) According to product security requirements, the password must be stored encrypted. Therefore, <strong id="EN-US_TOPIC_0000001188429106__b2030084973112529">UNENCRYPTED</strong> is forbidden in <span id="EN-US_TOPIC_0000001188429106__text773373177112529">GaussDB(DWS)</span>. If the password is SHA256-encrypted, it will be stored as-is, regardless of whether <strong id="EN-US_TOPIC_0000001188429106__b288743311112529">ENCRYPTED</strong> or <strong id="EN-US_TOPIC_0000001188429106__b2099941346112529">UNENCRYPTED</strong> is specified (since the system cannot decrypt the specified encrypted password). This allows reloading of the encrypted password during dump/restore.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l469e5d2ab27242dc9b22a737ed74e1e9"><strong id="EN-US_TOPIC_0000001188429106__a6aee8b27c38b417193b8ae99edd85a52">SYSADMIN | NOSYSADMIN</strong><p id="EN-US_TOPIC_0000001188429106__a63e11cab1bd048dcad53c811ec85bed7">Determines whether a new user is a system administrator. A user with the <strong id="EN-US_TOPIC_0000001188429106__b1459281271220">SYSADMIN</strong> attribute has the highest permission in the system.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a6bcc4681e24a494dab73d0a8a0684a1f">Value range: If not specified, <strong id="EN-US_TOPIC_0000001188429106__b167299377112529">NOSYSADMIN</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l154ea91f79394da2a25e1da850b5ca8a"><strong id="EN-US_TOPIC_0000001188429106__a3e78c9fc9d964552a2981df15b3d94d1">AUDITADMIN | NOAUDITADMIN</strong><p id="EN-US_TOPIC_0000001188429106__a1c00fd2ab14147f3974785c9778a5fd9">Defines whether a user has the audit administrator attribute.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a1e66b4b35ecb41438c4ed4ee1f08d80b">If not specified, <strong id="EN-US_TOPIC_0000001188429106__b1227876867112529">NOAUDITADMIN</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__ldf290c7cd5df44baa09d4a52661770b0"><strong id="EN-US_TOPIC_0000001188429106__a6ded5d100cf24343805b08b7ad071d15">CREATEDB | NOCREATEDB</strong><p id="EN-US_TOPIC_0000001188429106__aae41effec27d411880cf27d9c91baa11">Determines whether a new user can create a database.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a27deb77a15454fd2b2a161542d08c25b">A new user does not have the permission to create a database by default. Value range: If not specified, <strong id="EN-US_TOPIC_0000001188429106__b84026773112529">NOCREATEDB</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l3424f839118c4c609df1c8ffbedf397c"><strong id="EN-US_TOPIC_0000001188429106__en-us_topic_0059778189_b980517192214">USEFT | NOUSEFT</strong><p id="EN-US_TOPIC_0000001188429106__p147541802212">Determines whether a new role can perform operations on foreign tables, such as creating, deleting, modifying, and reading/witting foreign tables.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p1875416014215">The new user does not have the permission to perform operations on foreign tables.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p97541101428">The default value is <strong id="EN-US_TOPIC_0000001188429106__b1118936879112529">NOUSEFT</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l035cc39a123343d5bb8189cdad20fbaf"><strong id="EN-US_TOPIC_0000001188429106__a6eed77e247664af0bcf673e031d2fc7d">CREATEROLE | NOCREATEROLE</strong><p id="EN-US_TOPIC_0000001188429106__a5e409150d87140789294e4494f351c98">Determines whether a user can create a role or user (that is, execute CREATE ROLE and CREATE USER). A user with the CREATEROLE permission can also modify and delete other users or roles.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__ae55c6c4bd7c642a381884c914a453306">Value range: If not specified, <strong id="EN-US_TOPIC_0000001188429106__b1568047129112529">NOCREATEROLE</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l92ecd8b00f60413db185943583e6456e"><strong id="EN-US_TOPIC_0000001188429106__a6e6de8c56bfd4551bb876a4c241054fc">INHERIT | NOINHERIT</strong><p id="EN-US_TOPIC_0000001188429106__acce5329e9eaf4151999a0d61dcc5778d">Determines whether a user "inherits" the permissions of users in its group. You are not advised to use them.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__lc0f66a18869d4f669b3e4bbd16c44536"><strong id="EN-US_TOPIC_0000001188429106__a223b62e31d474820bafa2a267f2cc9e2">LOGIN | NOLOGIN</strong><p id="EN-US_TOPIC_0000001188429106__a97e8136a10c84a819b8ed8f3d2aaa018">Only users with the <strong id="EN-US_TOPIC_0000001188429106__b239943412149">LOGIN</strong> attribute can log in to the database.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__aa9732e40eaeb40d3a877850c985df2d9">Value range: If not specified, <strong id="EN-US_TOPIC_0000001188429106__b13792859775">LOGIN</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__ldb900af2e8c2402b98c1a026fef58a20"><strong id="EN-US_TOPIC_0000001188429106__aef8700eac76747c28896f8045b0192c3">REPLICATION | NOREPLICATION</strong><p id="EN-US_TOPIC_0000001188429106__ada2c8efc03ee4139a326b06c62d2eb8e">Determines whether a user is allowed to initiate streaming replication or put the system in and out of backup mode. A user with the REPLICATION attribute is only used for replication.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a82ab0023b8d54c0ca30d45d3c53d7fa7">If not specified, <strong id="EN-US_TOPIC_0000001188429106__b1060568447112529">NOREPLICATION</strong> is the default.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li1895661719567"><strong id="EN-US_TOPIC_0000001188429106__b0959817105616">INDEPENDENT | NOINDEPENDENT</strong><p id="EN-US_TOPIC_0000001188429106__p11291024175718">Defines private and independent users. For a user with the <strong id="EN-US_TOPIC_0000001188429106__b1375410568181">INDEPENDENT</strong> attribute, administrators' rights to control and access this role are separated. Specific rules are as follows:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429106__ul288816117715"><li id="EN-US_TOPIC_0000001188429106__li1689014111379">Administrators have no rights to add, delete, query, modify, copy, or authorize the corresponding table objects without the authorization from the <strong id="EN-US_TOPIC_0000001188429106__b2340115716491">INDEPENDENT</strong> user.</li><li id="EN-US_TOPIC_0000001188429106__li689518111878">Without the authorization of the <strong id="EN-US_TOPIC_0000001188429106__b17912165916187">INDEPENDENT</strong> user, the administrator has no right to modify its inheritance relationship.</li><li id="EN-US_TOPIC_0000001188429106__li698510283212">The administrator does not have the permission to change the owner of the table object of an <strong id="EN-US_TOPIC_0000001188429106__b280920161910">INDEPENDENT</strong> user.</li><li id="EN-US_TOPIC_0000001188429106__li179032017131915">The administrator does not have the permission to remove the <strong id="EN-US_TOPIC_0000001188429106__b9980132151910">INDEPENDENT</strong> attribute of an <strong id="EN-US_TOPIC_0000001188429106__b1098116221914">INDEPENDENT</strong> user.</li><li id="EN-US_TOPIC_0000001188429106__li289711111674">The administrator does not have the permission to change the database password of an <strong id="EN-US_TOPIC_0000001188429106__b93561277196">INDEPENDENT</strong> user. An <strong id="EN-US_TOPIC_0000001188429106__b1835657191910">INDEPENDENT</strong> must manage its own password. If the password is lost, it cannot be reset.</li><li id="EN-US_TOPIC_0000001188429106__li3589174815216">The <strong id="EN-US_TOPIC_0000001188429106__b899430027112529">SYSADMIN</strong> attribute of a user cannot be changed to the <strong id="EN-US_TOPIC_0000001188429106__b1151001041112529">INDEPENDENT</strong> attribute.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li17112842104519"><strong id="EN-US_TOPIC_0000001188429106__b187961830195119">VCADMIN | NOVCADMIN</strong><p id="EN-US_TOPIC_0000001188429106__p202677618479">Defines a logical cluster administrator. A logical cluster administrator has the following more permissions than common users:</p>
|
|
<ul id="EN-US_TOPIC_0000001188429106__ul162518307491"><li id="EN-US_TOPIC_0000001188429106__li4252030144919">Create, modify, and delete resource pools in the associated logical cluster.</li><li id="EN-US_TOPIC_0000001188429106__li173990316522">Grant the access permission for the associated logical cluster to other users or roles, or reclaim the access permission from those users or roles.</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l6a1e4dc88c02458a989b4fda0c5123ad"><strong id="EN-US_TOPIC_0000001188429106__a9b9bd1a153824892ac748fd5e4af3e09">CONNECTION LIMIT</strong><p id="EN-US_TOPIC_0000001188429106__a2b34dda5ffeb4f188bbe09767d0bd107">Specifies the number of concurrent connections that can be used by a user.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__a9c283f4dbbad4dc4984386f4bff685ab">Value range: Integer, <strong id="EN-US_TOPIC_0000001188429106__b48777216112529">>=-1</strong>. The default value is <strong id="EN-US_TOPIC_0000001188429106__b382983421112529">-1</strong>, which means unlimited.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188429106__note1582171075313"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188429106__p5821171045313">To ensure the proper running of a cluster, the minimum value of <strong id="EN-US_TOPIC_0000001188429106__b1194773849112529">CONNECTION LIMIT</strong> is the number of CNs in the cluster, because when a cluster runs ANALYZE on a CN, other CNs will connect with the running CN for metadata synchronization. For example, if there are three CNs in the cluster, set <strong id="EN-US_TOPIC_0000001188429106__b1093607420112529">CONNECTION LIMIT</strong> to <strong id="EN-US_TOPIC_0000001188429106__b21650711112529">3</strong> or a greater value.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l9c284e63792042c399162c50cfc33f46"><strong id="EN-US_TOPIC_0000001188429106__a44dc6e44004448ddbc4875642a0892ee">VALID BEGIN</strong><p id="EN-US_TOPIC_0000001188429106__abf85480b25d3412d8b860626ae69accc">Sets the timestamp when a user takes effect. If this clause is omitted, there is no restriction on when the user takes effect.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l22446bea45244494b99f66d5ce909984"><strong id="EN-US_TOPIC_0000001188429106__a9e2fb245a260410b9643bbc8fe674d70">VALID UNTIL</strong><p id="EN-US_TOPIC_0000001188429106__afde8eec8a98a43e4aa1b9a8ab967fe5e">Sets the timestamp when a user expires. If this clause is omitted, there is no restriction on when the user expires.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__lf044b37c11464e178aa96812d80e3de9"><strong id="EN-US_TOPIC_0000001188429106__a9df4bdfedc474974bdce21fd2c68dd69">RESOURCE POOL</strong><p id="EN-US_TOPIC_0000001188429106__a8028137e0c6e4136bc67774dcead3f80">Sets the name of resource pool used by a user, and the name belongs to the system catalog: <strong id="EN-US_TOPIC_0000001188429106__b14727192920199">pg_resource_pool</strong>.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__en-us_topic_0059778189_li86679166437"><strong id="EN-US_TOPIC_0000001188429106__en-us_topic_0059778189_b76681162439">USER GROUP 'groupuser'</strong><p id="EN-US_TOPIC_0000001188429106__adeaa821b83454200836ba8452d1d651e">Creates a sub-user. </p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li10718184715519"><strong id="EN-US_TOPIC_0000001188429106__b107187471511">PERM SPACE</strong><p id="EN-US_TOPIC_0000001188429106__p5718347553">Sets the storage space of the user permanent table.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p364617716442"><strong id="EN-US_TOPIC_0000001188429106__b128601632181919">space_limit</strong>: specifies the upper limit of the storage space of the permanent table. Value range: A string consists of an integer and unit. The unit can be K/M/G/T/P currently. <strong id="EN-US_TOPIC_0000001188429106__b19144125119816">0</strong> indicates no limits.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li1471812471953"><strong id="EN-US_TOPIC_0000001188429106__b137182471556">TEMP SPACE</strong><p id="EN-US_TOPIC_0000001188429106__p171811471055">Sets the storage space of the user temporary table.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p1232220153415"><strong id="EN-US_TOPIC_0000001188429106__b196143720192">tmpspacelimit</strong>: specifies the storage space limit of the temporary table. Value range: A string consists of an integer and unit. The unit can be K/M/G/T/P currently. <strong id="EN-US_TOPIC_0000001188429106__b61461751382">0</strong> indicates no limits.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li18718747056"><strong id="EN-US_TOPIC_0000001188429106__b6718184711518">SPILL SPACE</strong><p id="EN-US_TOPIC_0000001188429106__p67183471654">Sets the operator disk flushing space of the user.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p58101019337"><strong id="EN-US_TOPIC_0000001188429106__b1162873916191">spillspacelimit</strong>: specifies the operator spilling space limit. Value range: A string consists of an integer and unit. The unit can be K/M/G/T/P currently. <strong id="EN-US_TOPIC_0000001188429106__b46431045285">0</strong> indicates no limits.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li141813215538"><strong id="EN-US_TOPIC_0000001188429106__b311135741013">NODE GROUP</strong><p id="EN-US_TOPIC_0000001188429106__p19517338205413">Specifies the name of the logical cluster associated with a user. If the name contains uppercase characters or special characters, enclose the name with double quotation marks.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__ld34ac5ef6dc9430fb51f1103d2282450"><strong id="EN-US_TOPIC_0000001188429106__a4548455a1fc4480dba682a0a8de2b950">IN ROLE</strong><p id="EN-US_TOPIC_0000001188429106__a4adb21e1d55c48ae99f0bb5cc891bf90">The new user immediately has the permissions of users listed in the <strong id="EN-US_TOPIC_0000001188429106__b16718722102019">IN ROLE</strong> clause. You are not advised to execute them.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l5005ac12a44d4f8b951448015ab73b42"><strong id="EN-US_TOPIC_0000001188429106__aea14f008e44445d49164322fb8b50565">IN GROUP</strong><p id="EN-US_TOPIC_0000001188429106__a040fb5fa7b0a4c02b12a243c98a328a4">Indicates an obsolete spelling of <strong id="EN-US_TOPIC_0000001188429106__b781997067112529">IN ROLE</strong>. You are not advised to execute them.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l109243d395714892ac620502d727b32b"><strong id="EN-US_TOPIC_0000001188429106__a6c743717bc49400c8cc89da298516eea">ROLE</strong><p id="EN-US_TOPIC_0000001188429106__af32923f7aa084a328eb580a14fed0097">The <strong id="EN-US_TOPIC_0000001188429106__b948020514213">ROLE</strong> clause lists one or more existing users. They are automatically added as members of the new user and have all the permissions of the new user.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__le9544711f87944449e4ee2d45a1d8970"><strong id="EN-US_TOPIC_0000001188429106__a2f18427eeed949339625ce4799c04365">ADMIN</strong><p id="EN-US_TOPIC_0000001188429106__a48681bbbdc134ce3a60a2bab1036ad7b">The ADMIN clause is similar to the ROLE clause. The difference is that the user after <strong id="EN-US_TOPIC_0000001188429106__b93311627154512">ADMIN</strong> can grant the permissions of the new user to other users.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__ldb059f01f819477ea459d6d2df71e012"><strong id="EN-US_TOPIC_0000001188429106__a97888be7eb5b4a7db496508871148ac7">USER</strong><p id="EN-US_TOPIC_0000001188429106__a60f0e43beb2c43da89c5242299f83834">Indicates an obsolete spelling of the <strong id="EN-US_TOPIC_0000001188429106__b1757006155112529">ROLE</strong> clause.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l517d9b19712943a281034b38a35a6072"><strong id="EN-US_TOPIC_0000001188429106__a55297d28da0f4e82bbf6acdfd82fd2e1">SYSID</strong><p id="EN-US_TOPIC_0000001188429106__a7ef25e2375c54521bc214d3bf89b4636">The <strong id="EN-US_TOPIC_0000001188429106__b1044345058112529">SYSID</strong> clause is ignored.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l0f07b788b2f34feebcc5e86fa301dc7a"><strong id="EN-US_TOPIC_0000001188429106__ad998ef88e29d48ea856aca8de3b2c120">DEFAULT TABLESPACE</strong><p id="EN-US_TOPIC_0000001188429106__adf520511912f44cc93b77b677a34ef03">The <strong id="EN-US_TOPIC_0000001188429106__b348320227112529">DEFAULT TABLESPACE</strong> clause is ignored.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__l3406c5c43ea3445a9fad511a6ec12d23"><strong id="EN-US_TOPIC_0000001188429106__ae8355357cc934972896f0269f3cdc6a0">PROFILE</strong><p id="EN-US_TOPIC_0000001188429106__ae012841f20594facbab7c646fd866eef">The <strong id="EN-US_TOPIC_0000001188429106__b1917766687112529">PROFILE</strong> clause is ignored.</p>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__lfbaf6378a0284eed9b9a21656e380b82"><strong id="EN-US_TOPIC_0000001188429106__en-us_topic_0059778189_b154772336228">PGUSER</strong><p id="EN-US_TOPIC_0000001188429106__a88e98d09503f4a4e925af05c5e462400">This attribute is used to be compatible with open-source Postgres communication. An open-source Postgres client interface (Postgres 9.2.19 is recommended) can use a database user having this attribute to connect to the database.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188429106__nfc7c356aef0049989103e7cfd4258cb9"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188429106__ad74a75c627b0445984d9853e4afb950a">This attribute only ensures compatibility with the connection process. Incompatibility caused by kernel differences between this product and Postgres cannot be solved using this attribute.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__aa2096cdb0658453a8c07b72e7f0d1ff9">Users with the <strong id="EN-US_TOPIC_0000001188429106__b2083778446112529">PGUSER</strong> attribute are authenticated in a way different from other users. Error information reported by the open-source client may cause the attribute to be enumerated. Therefore, you are advised to use a client of this product. Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__s2361931054b74f89b5fffbd63a502bf5"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="o">#</span><span class="w"> </span><span class="n">normaluser</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="k">user</span><span class="w"> </span><span class="n">that</span><span class="w"> </span><span class="n">does</span><span class="w"> </span><span class="k">not</span><span class="w"> </span><span class="n">have</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">PGUSER</span><span class="w"> </span><span class="n">attribute</span><span class="p">.</span><span class="w"> </span><span class="n">psql</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">Postgres</span><span class="w"> </span><span class="n">client</span><span class="w"> </span><span class="n">tool</span><span class="p">.</span>
|
|
<span class="n">pg</span><span class="o">@</span><span class="n">dws04</span><span class="p">:</span><span class="o">~></span><span class="w"> </span><span class="n">psql</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="w"> </span><span class="n">postgres</span><span class="w"> </span><span class="o">-</span><span class="n">p</span><span class="w"> </span><span class="mi">8000</span><span class="w"> </span><span class="o">-</span><span class="n">h</span><span class="w"> </span><span class="mi">10</span><span class="p">.</span><span class="mi">11</span><span class="p">.</span><span class="mi">12</span><span class="p">.</span><span class="mi">13</span><span class="w"> </span><span class="o">-</span><span class="n">U</span><span class="w"> </span><span class="n">normaluser</span>
|
|
<span class="n">psql</span><span class="p">:</span><span class="w"> </span><span class="n">authentication</span><span class="w"> </span><span class="k">method</span><span class="w"> </span><span class="mi">10</span><span class="w"> </span><span class="k">not</span><span class="w"> </span><span class="n">supported</span>
|
|
|
|
<span class="o">#</span><span class="w"> </span><span class="n">pguser</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="k">user</span><span class="w"> </span><span class="k">having</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">PGUSER</span><span class="w"> </span><span class="n">attribute</span><span class="p">.</span>
|
|
<span class="n">pg</span><span class="o">@</span><span class="n">dws04</span><span class="p">:</span><span class="o">~></span><span class="w"> </span><span class="n">psql</span><span class="w"> </span><span class="o">-</span><span class="n">d</span><span class="w"> </span><span class="n">postgres</span><span class="w"> </span><span class="o">-</span><span class="n">p</span><span class="w"> </span><span class="mi">8000</span><span class="w"> </span><span class="o">-</span><span class="n">h</span><span class="w"> </span><span class="mi">10</span><span class="p">.</span><span class="mi">11</span><span class="p">.</span><span class="mi">12</span><span class="p">.</span><span class="mi">13</span><span class="w"> </span><span class="o">-</span><span class="n">U</span><span class="w"> </span><span class="n">pguser</span>
|
|
<span class="n">Password</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="k">user</span><span class="w"> </span><span class="n">pguser</span><span class="p">:</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li593418461504"><strong id="EN-US_TOPIC_0000001188429106__b10671113116">AUTHINFO 'authinfo'</strong><p id="EN-US_TOPIC_0000001188429106__p2093424695017">This attribute is used to specify the user authentication type. <strong id="EN-US_TOPIC_0000001188429106__b4965194815464">authinfo</strong> is the description character string, which is case sensitive. Only the LDAP type is supported. Its description character string is <strong id="EN-US_TOPIC_0000001188429106__b389323977112529">ldap</strong>. LDAP authentication is an external authentication mode. Therefore, <strong id="EN-US_TOPIC_0000001188429106__b1371911391112529">PASSWORD DISABLE</strong> must be specified.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001188429106__note1173418501247"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188429106__ul181322115112"><li id="EN-US_TOPIC_0000001188429106__li19260123151115">Additional information about LDAP authentication can be added to <strong id="EN-US_TOPIC_0000001188429106__b78264535112529">authinfo</strong>, for example, <strong id="EN-US_TOPIC_0000001188429106__b986614991112529">fulluser</strong> in LDAP authentication, which is equivalent to <strong id="EN-US_TOPIC_0000001188429106__b109986366112529">ldapprefix</strong>+<strong id="EN-US_TOPIC_0000001188429106__b634054589112529">username</strong>+<strong id="EN-US_TOPIC_0000001188429106__b1886588755112529">ldapsuffix</strong>. If the content of <strong id="EN-US_TOPIC_0000001188429106__b18136165218467">authinfo</strong> is <strong id="EN-US_TOPIC_0000001188429106__b16136175264610">ldap</strong>, the user authentication type is LDAP. In this case, the <strong id="EN-US_TOPIC_0000001188429106__b17137452114620">ldapprefix</strong> and <strong id="EN-US_TOPIC_0000001188429106__b51371052164612">ldapsuffix</strong> information is provided by the corresponding record in the <strong id="EN-US_TOPIC_0000001188429106__b21371052124610">pg_hba.conf</strong> file.</li><li id="EN-US_TOPIC_0000001188429106__li151322118119">When executing the <strong id="EN-US_TOPIC_0000001188429106__b1760687861112529">ALTER ROLE</strong> command, users are not allowed to change the authentication type. Only LDAP users are allowed to modify LDAP attributes.</li></ul>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001188429106__li9844852135819"><strong id="EN-US_TOPIC_0000001188429106__b9754442116">PASSWORD EXPIRATION period</strong><p id="EN-US_TOPIC_0000001188429106__p6845195210588">Number of days before the login password of the role expires. The user needs to change the password in time before the login password expires. If the login password expires, the user cannot log in to the system. In this case, the user needs to ask the administrator to set a new login password.</p>
|
|
<p id="EN-US_TOPIC_0000001188429106__p28451852175815">Value range: an integer ranging from -1 to 999. The default value is <strong id="EN-US_TOPIC_0000001188429106__b7979255164612">-1</strong>, indicating that there is no restriction. The value <strong id="EN-US_TOPIC_0000001188429106__b129794551464">0</strong> indicates that the login password expires immediately.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429106__s09bff25d2b394d54b798e90da9d05741"><h4 class="sectiontitle">Example</h4><p id="EN-US_TOPIC_0000001188429106__p195851335173718">Create user <strong id="EN-US_TOPIC_0000001188429106__b154386825633433">jim</strong>:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__screen1558503520378"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">jim</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{Password}'</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429106__p1458543583716">The following statements are equivalent to the above:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__screen458533503710"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">kim</span><span class="w"> </span><span class="n">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">'{Password}'</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001188429106__p10585113523711">For a user having the <strong id="EN-US_TOPIC_0000001188429106__b12079850433433">Create Database</strong> permission, add the <strong id="EN-US_TOPIC_0000001188429106__b151099998433433">CREATEDB</strong> keyword:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188429106__screen1558513543716"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">dim</span><span class="w"> </span><span class="k">CREATEDB</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'{Password}'</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001188429106__s72b6a79261c247a0bd70247bdfa5da4d"><h4 class="sectiontitle">Links</h4><p id="EN-US_TOPIC_0000001188429106__ab5a1cd48fb9d41f483d47e84410f176c"><a href="dws_06_0149.html">ALTER USER</a>, <a href="dws_06_0214.html">DROP USER</a></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|