12/20/2023 0 Comments Postgresql create database encoding![]() Copying such data would result in a database that is corrupt according to the new settings. This is because other databases might contain data that does not match the specified encoding, or might contain indexes whose sort ordering is affected by LC_COLLATE and LC_CTYPE. The encoding and locale settings must match those of the template database, except when template0 is used as template. (On Windows, however, UTF-8 encoding can be used with any locale.) CREATE DATABASE will allow superusers to specify SQL_ASCII encoding regardless of the locale settings, but this choice is deprecated and may result in misbehavior of character-string functions if data that is not encoding-compatible with the locale is stored in the database. If the locale is C (or equivalently POSIX), then all encodings are allowed, but for other locale settings there is only one encoding that will work properly. The character set encoding specified for the new database must be compatible with the chosen locale settings ( LC_COLLATE and LC_CTYPE). CREATE DATABASE will fail if any other connection exists when it starts otherwise, new connections to the template database are locked out until CREATE DATABASE completes. The principal limitation is that no other sessions can be connected to the template database while it is being copied. The program createdb is a wrapper program around this command, provided for convenience.ĭatabase-level configuration parameters (set via ALTER DATABASE) are not copied from the template database.Īlthough it is possible to copy a database other than template1 by specifying its name as the template, this is not (yet) intended as a general-purpose " COPY DATABASE" facility. Optional parameters can be written in any order, not only the order illustrated above.ĬREATE DATABASE cannot be executed inside a transaction block.Įrrors along the line of "could not initialize database directory" are most likely related to insufficient permissions on the data directory, a full disk, or other file system problems. How many concurrent connections can be made to this database. See CREATE TABLESPACE for more information. This tablespace will be the default tablespace used for objects created in this database. The name of the tablespace that will be associated with the new database, or DEFAULT to use the template database's tablespace. ![]() The default is to use the character classification of the template database. This affects the categorization of characters, e.g. lc_ctypeĬharacter classification ( LC_CTYPE) to use in the new database. The default is to use the collation order of the template database. in queries with ORDER BY, as well as the order used in indexes on text columns. This affects the sort order applied to strings, e.g. ![]() lc_collateĬollation order ( LC_COLLATE) to use in the new database. The character sets supported by the PostgreSQL server are described in Section 22.3.1. Specify a string constant (e.g., 'SQL_ASCII'), or an integer encoding number, or DEFAULT to use the default encoding (namely, the encoding of the template database). ![]() encodingĬharacter set encoding to use in the new database. The name of the template from which to create the new database, or DEFAULT to use the default template ( template1). To create a database owned by another role, you must be a direct or indirect member of that role, or be a superuser. The role name of the user who will own the new database, or DEFAULT to use the default (namely, the user executing the command). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |