【shell】 【postgresql】
连接到指定数据库
\c database_name
退出psql
\q
列出PostgreSQL数据库服务器中的所有数据库
\l
列出所有模式
\dn
列出所有存储过程和函数
\df
列出所有视图
\dv
列出当前数据库中的所有表
\dt
获取有关当前数据库中表的详细信息
\dt+
获取表格上的详细信息
\d+ table_name
显示存储过程或函数代码
\df+ function_name
漂亮的格式显示查询输出
\x
列出所有用户
\du
将表格导出为CSV文件
\copy TO '' CSV
将表格(仅特定列)导出到CSV文件
\copy (,,) TO '' CSV
将CSV文件导入到表中
\copy FROM '' CSV
将CSV文件导入表中,仅导入特定列
\copy (,,) FROM '' CSV
【shell】 【postgresql】
Connect to a specific database
\c database_name
To quite the psql
\q
List all databases in the PostgreSQL database server
\l
List all schemas
\dn
List all stored procedures and functions
\df
List all views
\dv
Lists all tables in a current database
\dt
Get more information on tables in the current database
\dt+
Get detailed information on a table
\d+ table_name
Show a stored procedure or function code
\df+ function_name
Show query output in the pretty-format
\x
List all users
\du
Export table into CSV file
\copy TO '' CSV
Export table, only specific columns, to CSV file
\copy (,,) TO '' CSV
Import CSV file into table
\copy FROM '' CSV
Import CSV file into table, only specific columns
\copy (,,) FROM '' CSV
分类列表:
腾图小抄 SCWY.net v0.03 小抄561条 自2022-01-02访问367231次