用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
[TOC] ## 创建数据库 语法: ``` createdb [option...] [dbname [description]] ``` example: ``` CREATE DATABASE dbname; ``` ## 查看数据库 命令行 ``` postgres=# \l 名称 | 拥有者 | 字元编码 | 校对规则 | Ctype | 存取权限 -----------+----------+----------+--------------------------------+--------------------------------+----------------------- dd | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | demo | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | hello | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | postgres | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | template0 | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | Chinese (Simplified)_China.936 | Chinese (Simplified)_China.936 | =c/postgres + | | | | | postgres=CTc/postgres ``` sql ``` > SELECT datname FROM pg_database; datname ----------- postgres demo template1 template0 hello dd ``` ## 进入 数据库 ``` postgres=# \c runoobdb ``` ## 删除数据库 语法 ``` DROP DATABASE [ IF EXISTS ] name ``` example ``` DROP DATABASE runoobdb; ```