{"id":9915,"date":"2017-04-02T09:02:33","date_gmt":"2017-04-02T07:02:33","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/"},"modified":"2017-04-02T09:02:33","modified_gmt":"2017-04-02T07:02:33","slug":"can-i-do-it-with-postgresql-13-create-database","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/","title":{"rendered":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database"},"content":{"rendered":"<p>Following the <a href=\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-12-dbca-database-configuration-assistant\/\" target=\"_blank\">last post<\/a> about which tools you can use to create your PostgreSQL instance in this post we&#8217;ll look at how you can do the &#8220;create database&#8221; part that you would do in Oracle when not using the <a href=\"http:\/\/docs.oracle.com\/database\/122\/ADMIN\/creating-and-configuring-an-oracle-database.htm#ADMIN-GUID-99A93810-62B1-4707-9995-89B3D0B5FB56\" target=\"_blank\">database configuration assistant<\/a>. Of course can can create a database in PostgreSQL but it is not the same as it is in Oracle. To actually create your Oracle database you would do something like this once you have the instance started in <a href=\"http:\/\/docs.oracle.com\/database\/122\/ADMIN\/creating-and-configuring-an-oracle-database.htm#ADMIN11079\" target=\"_blank\">nomount<\/a> mode:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\nstartup nomount pfile=\"\/u01\/app\/oracle\/admin\/DB4\/create\/init.ora\";\nCREATE DATABASE \"DB4\"\nMAXINSTANCES 8\nMAXLOGHISTORY 1\nMAXLOGFILES 16\nMAXLOGMEMBERS 3\nMAXDATAFILES 1024\nDATAFILE '\/u02\/oradata\/DB4\/system01DB4.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE 2048M\nEXTENT MANAGEMENT LOCAL\nSYSAUX DATAFILE '\/u02\/oradata\/DB4\/sysaux01DB4.dbf' SIZE 600M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE 2048M\nSMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '\/u02\/oradata\/DB4\/temp01DB4.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE 2048M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1024K\nSMALLFILE UNDO TABLESPACE \"UNDOTBS1\" DATAFILE  '\/u02\/oradata\/DB4\/undotbs01DB4.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE 2048M\nCHARACTER SET AL32UTF8\nNATIONAL CHARACTER SET AL16UTF16\nLOGFILE GROUP 1 ('\/u03\/oradata\/DB4\/redog1m1DB4.dbf','\/u04\/oradata\/DB4\/redog1m2DB4.dbf') SIZE 50M,\nGROUP 2 ('\/u03\/oradata\/DB4\/redog2m1DB4.dbf','\/u04\/oradata\/DB4\/redog2m2DB4.dbf') SIZE 50M,\nGROUP 3 ('\/u03\/oradata\/DB4\/redog3m1DB4.dbf','\/u04\/oradata\/DB4\/redog3m2DB4.dbf') SIZE 50M,\nGROUP 4 ('\/u03\/oradata\/DB4\/redog4m1DB4.dbf','\/u04\/oradata\/DB4\/redog4m2DB4.dbf') SIZE 50M,\nGROUP 5 ('\/u03\/oradata\/DB4\/redog5m1DB4.dbf','\/u04\/oradata\/DB4\/redog5m2DB4.dbf') SIZE 50M,\nGROUP 6 ('\/u03\/oradata\/DB4\/redog6m1DB4.dbf','\/u04\/oradata\/DB4\/redog6m2DB4.dbf') SIZE 50M\nUSER SYS IDENTIFIED BY \"&amp;&amp;sysPassword\" USER SYSTEM IDENTIFIED BY \"&amp;&amp;systemPassword\"\nenable pluggable database\nseed file_name_convert=('\/u02\/oradata\/DB4\/system01DB4.dbf','\/u02\/oradata\/DB4\/pdbseed\/system01DB4.dbf','\/u02\/oradata\/DB4\/sysaux01DB4.dbf','\/u02\/oradata\/DB4\/pdbseed\/sysaux01DB4.dbf','\/u02\/oradata\/DB4\/temp01DB4.dbf','\/u02\/oradata\/DB4\/pdbseed\/temp01DB4.dbf','\/u02\/oradata\/DB4\/undotbs01DB4.dbf','\/u02\/oradata\/DB4\/pdbseed\/undotbs01DB4.dbf') LOCAL UNDO ON;\n<\/pre>\n<p>Once this completed you start creating the catalog and install additional stuff that you need for your application (e.g. <a href=\"http:\/\/docs.oracle.com\/database\/122\/CCAPP\/toc.htm\" target=\"_blank\">Oracle Text<\/a> or <a href=\"http:\/\/docs.oracle.com\/database\/122\/SPATL\/toc.htm\" target=\"_blank\">Oracle Spatial<\/a>). How does that work in PostgreSQL?<\/p>\n<p><!--more--><\/p>\n<p>In the last post we had a very quick look at <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/app-initdb.html\" target=\"_blank\">initdb<\/a>. To create the PostgreSQL database cluster you have to use initdb, there is no other possibility. When you take a look at the options you can provide to initdb there are not too much. The only mandatory parameter is &#8220;-D&#8221; or &#8220;&#8211;pgdata&#8221;. This tells initdb where you want to have the files created on disk:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/home\/postgres\/ [pg962final] initdb -D \/home\/postgres\/test\/\nThe files belonging to this database system will be owned by user \"postgres\".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locales\n  COLLATE:  en_US.UTF-8\n  CTYPE:    en_US.UTF-8\n  MESSAGES: en_US.UTF-8\n  MONETARY: de_CH.UTF-8\n  NUMERIC:  de_CH.UTF-8\n  TIME:     en_US.UTF-8\nThe default database encoding has accordingly been set to \"UTF8\".\nThe default text search configuration will be set to \"english\".\n\nData page checksums are disabled.\n\nfixing permissions on existing directory \/home\/postgres\/test ... ok\ncreating subdirectories ... ok\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting dynamic shared memory implementation ... posix\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\nWARNING: enabling \"trust\" authentication for local connections\nYou can change this by editing pg_hba.conf or using the option -A, or\n--auth-local and --auth-host, the next time you run initdb.\n\nSuccess. You can now start the database server using:\n\n    pg_ctl -D \/home\/postgres\/test\/ -l logfile start\n<\/pre>\n<p>There are some important messages which got printed to the screen. The first two lines tell us that all the files will be owned by the operating system user which invoked initdb, postgres, and that the same user must be used to start the instance. Then it gets more interesting as it is about the default encoding\/characterset for the <a href=\"https:\/\/www.dbi-services.com\/blog\/what-the-hell-are-these-template0-and-template1-databases-in-postgresql\/\" target=\"_blank\">template database<\/a>. When you do not specify what you want you get the default of you operating system session:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"> \npostgres@pgbox:\/home\/postgres\/ [pg962final] locale\nLANG=en_US.UTF-8\nLC_CTYPE=\"en_US.UTF-8\"\nLC_NUMERIC=de_CH.UTF-8\nLC_TIME=\"en_US.UTF-8\"\nLC_COLLATE=\"en_US.UTF-8\"\nLC_MONETARY=de_CH.UTF-8\nLC_MESSAGES=\"en_US.UTF-8\"\nLC_PAPER=de_CH.UTF-8\nLC_NAME=de_CH.UTF-8\nLC_ADDRESS=de_CH.UTF-8\nLC_TELEPHONE=de_CH.UTF-8\nLC_MEASUREMENT=de_CH.UTF-8\nLC_IDENTIFICATION=de_CH.UTF-8\nLC_ALL=\n<\/pre>\n<p>Of course you can override that by passing any of the supported <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" target=\"_blank\">character sets<\/a> to initdb, e.g.:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"> \npostgres@pgbox:\/home\/postgres\/ [pg962final] rm -rf test\npostgres@pgbox:\/home\/postgres\/ [pg962final] mkdir test\npostgres@pgbox:\/home\/postgres\/ [pg962final] initdb -D test --encoding=LATIN1 --locale=de_DE\n<\/pre>\n<p>You can control how <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/locale.html\" target=\"_blank\">sorting and the display for numbers, money and so on<\/a> shall happen by specifying the various &#8220;&#8211;lc&#8221; parameters, e.g.:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"> \npostgres@pgbox:\/home\/postgres\/ [pg962final] rm -rf test\npostgres@pgbox:\/home\/postgres\/ [pg962final] mkdir test\npostgres@pgbox:\/home\/postgres\/ [pg962final] initdb -D test --encoding=LATIN1 --locale=de_DE --lc-messages=en_US --lc-monetary=de_DE\n<\/pre>\n<p>PostgreSQL comes with <a href=\"https:\/\/www.postgresql.org\/docs\/9.6\/static\/textsearch.html\" target=\"_blank\">build-in full text search<\/a> and the line below the encoding stuff tells you that the default will be English. Can overwrite this as well with the &#8220;&#8211;text-search-config&#8221; parameter of initdb.<\/p>\n<p>Maybe the most important message is this:&#8221;Data page checksums are disabled.&#8221;. This means that PostgreSQL will not use checksums to detect <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_corruption#Silent\" target=\"_blank\">silent data corruptions<\/a>. Of course this introduces overhead when enabled but your data usually is important, isn&#8217;t it? You can enable this by using the &#8220;&#8211;data-checksums&#8221; switch of initdb and this cannot be changed afterwards.<\/p>\n<p>The last message we will look at for now is this one: &#8220;fixing permissions on existing directory \/home\/postgres\/test &#8230; ok&#8221;. What does that mean? When you look at the permissions of the files and directories that got created by initdb you&#8217;ll notice that only the owner of the files and directories has permission (no permission for group and world):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\ndrwx------. 19 postgres postgres      4096 Mar 31 11:07 test\npostgres@pgbox:\/home\/postgres\/ [pg962final] ls -al test\/\ntotal 56\ndrwx------. 19 postgres postgres  4096 Mar 31 11:07 .\ndrwx------. 10 postgres postgres  4096 Mar 31 10:51 ..\ndrwx------.  5 postgres postgres    38 Mar 31 11:07 base\ndrwx------.  2 postgres postgres  4096 Mar 31 11:07 global\ndrwx------.  2 postgres postgres    17 Mar 31 11:07 pg_clog\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_commit_ts\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_dynshmem\n-rw-------.  1 postgres postgres  4468 Mar 31 11:07 pg_hba.conf\n-rw-------.  1 postgres postgres  1636 Mar 31 11:07 pg_ident.conf\ndrwx------.  4 postgres postgres    37 Mar 31 11:07 pg_logical\ndrwx------.  4 postgres postgres    34 Mar 31 11:07 pg_multixact\ndrwx------.  2 postgres postgres    17 Mar 31 11:07 pg_notify\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_replslot\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_serial\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_snapshots\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_stat\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_stat_tmp\ndrwx------.  2 postgres postgres    17 Mar 31 11:07 pg_subtrans\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_tblspc\ndrwx------.  2 postgres postgres     6 Mar 31 11:07 pg_twophase\n-rw-------.  1 postgres postgres     4 Mar 31 11:07 PG_VERSION\ndrwx------.  3 postgres postgres    58 Mar 31 11:07 pg_xlog\n-rw-------.  1 postgres postgres    88 Mar 31 11:07 postgresql.auto.conf\n-rw-------.  1 postgres postgres 22258 Mar 31 11:07 postgresql.conf\n<\/pre>\n<p>When you change that PostgreSQL will refuse to start:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/home\/postgres\/ [pg962final] chmod 770 test\/\npostgres@pgbox:\/home\/postgres\/ [pg962final] pg_ctl -D test\/ start\nserver starting\npostgres@pgbox:\/home\/postgres\/ [pg962final] FATAL:  data directory \"\/home\/postgres\/test\" has group or world access\nDETAIL:  Permissions should be u=rwx (0700).\n<\/pre>\n<p>Now that we have everything initialized on disk we are ready to start the instance:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/home\/postgres\/ [pg962final] pg_ctl -D \/home\/postgres\/test\/ start\npostgres@pgbox:\/home\/postgres\/ [pg962final] LOG:  database system was shut down at 2017-03-31 11:07:05 CEST\nLOG:  MultiXact member wraparound protections are now enabled\nLOG:  autovacuum launcher started\nLOG:  database system is ready to accept connections\npostgres@pgbox:\/home\/postgres\/ [pg962final] psql postgres\npsql (9.6.2 dbi services build)\nType \"help\" for help.\n\npostgres=\n<\/pre>\n<p>From now on you can <a href=\"https:\/\/www.postgresql.org\/docs\/9.6\/static\/sql-createdatabase.html\" target=\"_blank\">create a database<\/a>:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# create database mydb;\nCREATE DATABASE\npostgres=# \\l\n                                  List of databases\n   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   \n-----------+----------+----------+-------------+-------------+-----------------------\n mydb      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | \n postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | \n template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c\/postgres          +\n           |          |          |             |             | postgres=CTc\/postgres\n template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c\/postgres          +\n           |          |          |             |             | postgres=CTc\/postgres\n<\/pre>\n<p>Check <a href=\"https:\/\/www.dbi-services.com\/blog\/what-the-hell-are-these-template0-and-template1-databases-in-postgresql\/\" target=\"_blank\">here<\/a> if you want to know what the other databases are for. When you compare that to the Oracle &#8220;create database&#8221; statement it creates something like a pluggable database and you can create as many as you want. Inside the database you have the usual objects (schemata,tables,views,&#8230;). You can even change the encoding for new databases:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# create database mydb2 encoding='LATIN1' LC_COLLATE='de_CH.iso88591' LC_CTYPE='de_CH.iso88591' template=template0;\nCREATE DATABASE\npostgres=# \\l\n                                     List of databases\n   Name    |  Owner   | Encoding |    Collate     |     Ctype      |   Access privileges   \n-----------+----------+----------+----------------+----------------+-----------------------\n mydb      | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | \n mydb2     | postgres | LATIN1   | de_CH.iso88591 | de_CH.iso88591 | \n postgres  | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | \n template0 | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | =c\/postgres          +\n           |          |          |                |                | postgres=CTc\/postgres\n template1 | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | =c\/postgres          +\n           |          |          |                |                | postgres=CTc\/postgres\n(5 rows)\n<\/pre>\n<p>Important to know is that users are global so you can not create users inside databases but of course you can grant access to databases to different users and users can be owners of databases:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres=# alter database mydb owner to myusr;\nALTER DATABASE\npostgres=# \\l\n                                     List of databases\n   Name    |  Owner   | Encoding |    Collate     |     Ctype      |   Access privileges   \n-----------+----------+----------+----------------+----------------+-----------------------\n mydb      | myusr    | UTF8     | en_US.UTF-8    | en_US.UTF-8    | \n mydb2     | postgres | LATIN1   | de_CH.iso88591 | de_CH.iso88591 | \n postgres  | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | \n template0 | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | =c\/postgres          +\n           |          |          |                |                | postgres=CTc\/postgres\n template1 | postgres | UTF8     | en_US.UTF-8    | en_US.UTF-8    | =c\/postgres          +\n           |          |          |                |                | postgres=CTc\/postgres\n(5 rows)\n<\/pre>\n<p>How can you then install options into the databases? There are none, all is included. What maybe comes closest to what Oracle calls options are <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/contrib.html\" target=\"_blank\">extensions or modules<\/a>. Some of them are provided by default and you can find them usually in the &#8220;share\/extension&#8221; directory where you installed the PostgreSQL binaries:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/u01\/app\/postgres\/product\/96\/db_2\/ [pg962final] ls\nbin  include  lib  share\npostgres@pgbox:\/u01\/app\/postgres\/product\/96\/db_2\/ [pg962final] ls share\/extension\/\nadminpack--1.0.sql                  hstore--1.3--1.4.sql                  pageinspect.control                      plperlu--unpackaged--1.0.sql\nadminpack.control                   hstore--1.4.sql                       pageinspect--unpackaged--1.0.sql         plpgsql--1.0.sql\n...\n<\/pre>\n<p>All of those can be installed per database, e.g.:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">\npostgres@pgbox:\/home\/postgres\/ [pg962final] psql postgres\npsql (9.6.2 dbi services build)\nType \"help\" for help.\n\npostgres=# \\connect mydb\nYou are now connected to database \"mydb\" as user \"postgres\".\nmydb=# create extension hstore;\nCREATE EXTENSION\nmydb=# \\dx\n                           List of installed extensions\n  Name   | Version |   Schema   |                   Description                    \n---------+---------+------------+--------------------------------------------------\n hstore  | 1.4     | public     | data type for storing sets of (key, value) pairs\n plpgsql | 1.0     | pg_catalog | PL\/pgSQL procedural language\n(2 rows)\n\nmydb=# \n<\/pre>\n<p>Others are not available by default and you usually need to download them from <a href=\"https:\/\/github.com\/\" target=\"_blank\">github<\/a>, e.g.<br \/>\n<a href=\"https:\/\/github.com\/citusdata\/cstore_fdw\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\" alt=\"cstore\" width=\"988\" height=\"304\" class=\"aligncenter size-full wp-image-15529\" \/><\/a><\/p>\n<p>For an overview can you check the <a href=\"https:\/\/pgxn.org\/\" target=\"_blank\">PostgreSQL Extension Network<\/a>.<\/p>\n<p>Conclusion: You need to use <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/app-initdb.html\" target=\"_blank\">initdb<\/a> to initialize all the files for your PostgreSQL instance on disk. Use <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/app-pg-ctl.html\" target=\"_blank\">pg_ctl<\/a> to start your instance and then you are ready to create databases. Hope this helps for starting with PostgreSQL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following the last post about which tools you can use to create your PostgreSQL instance in this post we&#8217;ll look at how you can do the &#8220;create database&#8221; part that you would do in Oracle when not using the database configuration assistant. Of course can can create a database in PostgreSQL but it is not [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":9916,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[586],"type_dbi":[],"class_list":["post-9915","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","tag-postegresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Can I do it with PostgreSQL? \u2013 13 \u2013 create database - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Can I do it with PostgreSQL? \u2013 13 \u2013 create database\" \/>\n<meta property=\"og:description\" content=\"Following the last post about which tools you can use to create your PostgreSQL instance in this post we&#8217;ll look at how you can do the &#8220;create database&#8221; part that you would do in Oracle when not using the database configuration assistant. Of course can can create a database in PostgreSQL but it is not [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-02T07:02:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\" \/>\n\t<meta property=\"og:image:width\" content=\"988\" \/>\n\t<meta property=\"og:image:height\" content=\"304\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"Can I do it with PostgreSQL? \u2013 13 \u2013 create database\",\"datePublished\":\"2017-04-02T07:02:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\"},\"wordCount\":717,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\",\"keywords\":[\"PostegreSQL\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\",\"name\":\"Can I do it with PostgreSQL? \u2013 13 \u2013 create database - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\",\"datePublished\":\"2017-04-02T07:02:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png\",\"width\":988,\"height\":304},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Can I do it with PostgreSQL? \u2013 13 \u2013 create database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/","og_locale":"en_US","og_type":"article","og_title":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database","og_description":"Following the last post about which tools you can use to create your PostgreSQL instance in this post we&#8217;ll look at how you can do the &#8220;create database&#8221; part that you would do in Oracle when not using the database configuration assistant. Of course can can create a database in PostgreSQL but it is not [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/","og_site_name":"dbi Blog","article_published_time":"2017-04-02T07:02:33+00:00","og_image":[{"width":988,"height":304,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png","type":"image\/png"}],"author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database","datePublished":"2017-04-02T07:02:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/"},"wordCount":717,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png","keywords":["PostegreSQL"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/","url":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/","name":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png","datePublished":"2017-04-02T07:02:33+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/cstore.png","width":988,"height":304},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-13-create-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Can I do it with PostgreSQL? \u2013 13 \u2013 create database"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=9915"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9915\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/9916"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9915"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=9915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}