CREATE DATABASE name [ [ WITH ] [ OWNER [=] dbowner ] [ TEMPLATE [=] template ] [ ENCODING [=] encoding ] [ TABLESPACE [=] tablespace ] [ CONNECTION LIMIT [=] connlimit ] ]
CREATE DATABASE 录傺婔婻桄昄扞康㔗
襕录傺婔婻昄扞康嘹媙釂滇婔婻轙亓䫘潙潡蔙橬䬹枪䔇 CREATEDB 溄鍊㔗埗黙 CREATE USER 㔗
锔婩录傺蔙儖潊婺桄昄扞康䔇䞇䊖叻㔗轙亓䫘潙埇傖䫘 OWNER 床埖录傺噽垄䫘潙欔橬䔇昄扞康㔗䫔躿埇傖录傺澇橬䬹枪溄鍊䔇䫘潙欔拖橬䔇昄扞康㔗橬 CREATEDB 溄鍊䔇麂轙亓䫘潙嘪䫘埻脘录傺躻噌嘪䫘䔇昄扞康㔗
䚺䩕施桄昄扞康儖锔誺噋锖湺庖係䂘昄扞康 template1 準录傺㔗埇傖锔誺 TEMPLATE name 毺垔婉劯䔇昇溪㔗儴噽滇䫘 TEMPLATE template0 录傺婔婻冽亇应䔇㔕埻寙拸 PostgreSQL 鵇垔幬䔇湺庖凹茇䔇昄扞康㔗認婻桹濘埇傖镪噉檪傂嘘噾䂟媹噖彄 template1 麯䔇橸婄垬輙凹茇拙蘺彄桄昄扞康㔗
襕录傺䔇昄扞康劉庖
昄扞康䫘潙䔇劉庖傡儖拖橬桄昄扞康潡蔙滇喍 DEFAULT 嘪䫘䚺䩕䫘潙(幘儌滇欓臯变傴䔇䫘潙)㔗
昇溪劉(傯巻婻昇溪录傺桄昄扞康)潡蔙䫘 DEFAULT 嘪䫘䚺䩕昇溪(template1)㔗
录傺桄昄扞康嘪䫘䔇庖严䚡乕㔗埇傖嘪䫘桺橸劉庖(冋套 'SQL_ASCII')㔕昘昄䚡埙㔕DEFAULT(昇䬽昄扞康䔇䚡乕)㔗PostgreSQL 橉媇単櫇毕䔇庖严镖婘誗21.2.1麯柟誄㔗
启桄昄扞康噿蕫䔇臘䷺閘劉庖潡蔙䫘 DEFAULT 臘䴺昇䬽昄扞康䔇臘䷺閘㔗認婻臘䷺閘儖潊婺婘認婻昄扞康麯录傺䔇凹茇䔇䚺䩕臘䷺閘㔗埗黙 CREATE TABLESPACE 诙埡敘崔媇敇㔗
昄扞康埇傖毖埖崔儏幽埏䔇誂毖㔗-1(䚺䩕)懟叿五澇橬鍊彽㔗
埇锬埗昄埇傖毬傂懟釺废幥喍蔯婉備備滇婪麵滆䴺䔇釺废㔗
CREATE DATABASE 婉脘婘庋媇庖麯麵欓臯㔗
䌂嚚"could not initialize database directory"認湙䔇髍臇橔橬埇脘滇啹婺昄扞䕞嘘䔇溄鍊婉崘潡蔙伕䕻悇幋䌂䔇桺傽係䂘閞鵻㔗
嘪䫘 DROP DATABASE 役鍴婔婻昄扞康
䘋废 createdb 滇認婻变傴䔇儕輙嘪䫘敘媹桹冪㔗
儘䞇埇傖锔誺檪昊昄扞康劉弄滯婺昇溪(蔯麂 template1)嘖滇認(誻)婉滇婔婻锔䫘䔇"COPY DATABASE"媘脘㔗婂襕䔇鍊彽滇婘傯昇䬽崉彽䔇施唍婉噕螩橬噽垄嚔臺鷆毖彄昇䬽昄扞康婪㔗套悩婘嚔哋欓臯 CREATE DATABASE 䔇施唍橬噽垄嚔臺溼誂毖婘昇䬽昄扞康婪闼幽儖嚔崌蘖劥彍䕘彄 CREATE DATABASE 垯潊幋劯欉噕螩傺䆋桄䔇嚔臺誂毖㔗埗蓕誗19.3诙埡敘崔媇敇㔗
CONNECTION LIMIT 锬釹埻滇誏嚚婄嚺彽套悩婴婻桄䔇誂毖庹幯劯施埏蕙蔯埻嬷婋婔婻誂毖"擘嘉"庖闼幽冽埇脘婴婻誂毖鄘崌昽㔗劯湙認婻鍊彽幽婉嚺媹婘轙亓䫘潙婪㔗