![]() template0 should never be changed after the database cluster has been initialized. This database contains the same data as the initial contents of template1, that is, only the standard objects predefined by your version of PostgreSQL. There is a second standard system database named template0. For example, if you install the procedural language PL/Perl in template1, it will automatically be available in user databases without any extra action being taken when those databases are created. This behavior allows site-local modifications to the standard set of objects in databases. If you add objects to template1, these objects will be copied into subsequently created user databases. Thus that database is the “ template” from which new databases are made. By default, it copies the standard system database named template1. This is because PostgreSQL will not make any assumptions about the rights intended for the new user, nor about the new user's name.CREATE DATABASE actually works by copying an existing database. Or username arguments are omitted, createuser will prompt you for each missingĪrgument. Prevents output from being sent to stdout (though errors will Pg_hba.conf file is configured not to trust the requesting host.Ĭauses the CREATE USER command sent to PostgreSQL to be displayed to the screen as it is ![]() Results in a password prompt for the connecting user, which happens automatically if the (The default is to connect using the name of the system user executing the createuser script). Specifies that USERNAME will be the user who connects to PostgreSQL Specifies that the database connection will be made on port PORT, rather than the Specifies that HOSTNAME will be connected to, rather than the localhost, or the host defined Results in a password prompt allowing you to set the password of the new user username. Explicitly indicates that the new user is not a superuser. Allows the new user to create users, and raises the status of the user to a superuser (enablingĮquivalent to the NOCREATEUSER keyword of the CREATE USER This is the default.Įquivalent to the CREATEUSER keyword of the CREATE USER Explicitly indicates that the new user may not create databases. Allows the new user to create databases.Įquivalent to the NOCREATEDB keyword of the CREATE USER These set the password for dbuser toĭbuS3r, which will be valid until November 11th, 2002.Įquivalent to the CREATEDB keyword of the CREATE USER Notice also the use of the WITH PASSWORD and This is achieved by specifying the CREATEDB See Chapter 9, for more on this the topic of creatingĮxample 10-2 illustrates the creation of a user named dbuser who Well as drop any databases which they own. This allows the named user to arbitrarily create databases, as PostgreSQL users, you may specify the CREATEDB keyword rather thanĬREATEUSER. If you wish to create a user who has the ability to create databases within PostgreSQL but not create or destroy This message indicates that a user with the name salesuser already exists. This message is returned if the user issuing the CREATE USER command is not a superuser.ĮRROR: CREATE USER: user name "salesuser" already exists By omitting the VALID UNTIL clause, this password will never expires. Sets a password of N0rm4! by the use of the WITH PASSWORDĬlause. Perform the statements which they have been granted access to (see the Section called Granting Privileges" for more on granting rights).Įxample 10-1 creates a normal user named salesuser. Such users may connect to databases in PostgreSQL, but they can only Other users, nor may they destroy databases or users. Users are implicitly "normal" with no special rights. Sets the user's password to be valid indefinitely.īy not specifying either CREATEDB or CREATEUSER, Sets the user's password to expire at abstime, which must be of a recognizable timestamp format.Īfter that date, the password must be reset, and the expiration moved forward. The group(s) must exist in order for the statement to succeed. NOCREATEUSERĮxplicitly enforces the default, which is the lack of this right.Īdds the new user to the group named groupname. ![]() Therefore have all rights, in all databases (including the rights to create a database, even ![]() Notice that a user with the rights to create other users will Grants the right to create new users, which NOCREATEDB explicitly enforces the default, which is the lack of this right. Specifying the CREATEDB keyword grants the new user the right to create newĭatabases, as well as the right to destroy databases which they own. Sets the new user's password to password. Specifies that the system ID is to be set to the value of uid.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |