当前位置:网站首页>PostgreSQL create database
PostgreSQL create database
2022-06-11 15:53:00 【happytree001】
One 、 Environmental Science
docker Compiled in postgreSQL14.2
[email protected]:~$ /usr/local/pgsql/bin/psql
psql (14.2)
Type "help" for help.
postgres=# select version();
version
--------------------------------------------------------------------------------------------------
PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, 64-bit
(1 row)
Two 、 Create database
2.1 Use createdb
src/bin/scripts/createdb.c
[email protected]:~$ /usr/local/pgsql/bin/createdb --help
createdb creates a PostgreSQL database.
Usage:
createdb [OPTION]... [DBNAME] [DESCRIPTION]
Options:
-D, --tablespace=TABLESPACE default tablespace for the database
-e, --echo show the commands being sent to the server
-E, --encoding=ENCODING encoding for the database
-l, --locale=LOCALE locale settings for the database
--lc-collate=LOCALE LC_COLLATE setting for the database
--lc-ctype=LOCALE LC_CTYPE setting for the database
-O, --owner=OWNER database user to own the new database
-T, --template=TEMPLATE template database to copy
-V, --version output version information, then exit
-?, --help show this help, then exit
Connection options:
-h, --host=HOSTNAME database server host or socket directory
-p, --port=PORT database server port
-U, --username=USERNAME user name to connect as
-w, --no-password never prompt for password
-W, --password force password prompt
--maintenance-db=DBNAME alternate maintenance database
By default, a database with the same name as the current user is created.
Report bugs to <[email protected]>.
PostgreSQL home page: <https://www.postgresql.org/>
[email protected]:~$ /usr/local/pgsql/bin/createdb -h 127.0.0.1 -p 5432 mydb
2.2 Use psql Command line
[email protected]:~$ /usr/local/pgsql/bin/psql
psql (14.2)
Type "help" for help.
postgres=# CREATE DATABASE test2;
CREATE DATABASE
postgres=#
3、 ... and 、 Delete database
postgres=# DROP DATABASE test2;
<p>DROP DATABASE</p>
postgres=#
边栏推荐
- HowNet has been filed for investigation; Byte beat established Tiktok group or listed in Hong Kong; The nail was exposed to be cut by 30%; Beijing's per capita deposit exceeds 200000 yuan | Q informat
- Shutter-- page Jump animation
- openGauss 多线程架构启动过程详解
- Memory optimization table mot management
- Classmate, have you heard of mot?
- Thales cloud security report shows that cloud data leakage and complexity are on the rise
- 数据库资源负载管理(上篇)
- 【愚公系列】2022年06月 .NET架构班 076-分布式中间件 ScheduleMaster的执行原理
- 【0006】title、關鍵字及頁面描述
- After nine years of testing, the salary for interviewing Huawei is 10000. Huawei employees: the company doesn't have such a low salary position
猜你喜欢
![[Yugong series] June 2022 Net architecture class 078 worker cluster of distributed middleware schedulemaster](/img/73/5636ba7a0772c4f9e2d1174df40839.png)
[Yugong series] June 2022 Net architecture class 078 worker cluster of distributed middleware schedulemaster

Nielseniq announces appointment of Tracey Massey as chief operating officer

【0006】title、关键字及页面描述

openGauss数据库闪回功能验证

Maui introductory tutorial series (1. framework introduction)

From repeatedly rejected manuscripts to post-90s assistant professor, Wang Hao of Rutgers University: curiosity drives me to constantly explore

使用Cloud DB构建APP 快速入门-快游戏篇

将配置导出到FTP或TFTP服务器

Go language - array

Analysis of the execution process of opengauss simple query SQL
随机推荐
Overview and operation of database dense equivalent query
openGauss简单查询SQL的执行流程解析
验证码是自动化的天敌?阿里研究出了解决方法
推开混合云市场大门,Lenovo xCloud的破局之道
Yiwenjiaohui your database system tuning
Opengauss AI capability upgrade to create a new AI native database
Hands on, how should selenium deal with pseudo elements?
Why are bugs changing more and more?
Analysis of breadcrumb usage scenarios on websites
Kaixia was selected into the 2022 global top 100 innovation institutions list of Kerui Weian
Using cloud DB to build app quick start -server
AI tool for cutting-edge technology exploration: analog detection
泰雷兹云安全报告显示,云端数据泄露和复杂程度呈上升趋势
中山大学大气院徐伟新教授团队关于弱对流造成极端降水的研究成果被Science亮点报道
Google Earth engine (GEE) - create a simple panel demo to display the map
Learn how to parse SQL from kernel code
Zero foundation self-study software test, I spent 7 days sorting out a set of learning routes, hoping to help you
Unified record of my code variable names
Using cloud DB to build app quick start - quick application
Memory optimization table mot management