Postgre: Some useful command of Postgre
2016-03-10 15:38
357 查看
Postgre is a SQL like database. However, there are some difference between it and MySQL in the perspective of command.
1) show tables <==> \dt
Or use the select sentence:
SELECT * FROM pg_catalog.pg_tables
2) show databases <==> \l
Or use the select sentence:
select datname from pg_database;
3) Delete all the rows of a table:
DELETE FROM tablename;
If you need to have a filter:
DELETE FROM weather WHERE city = 'Hayward';
4) Switch to another dataset
\c databasename
1) show tables <==> \dt
Or use the select sentence:
SELECT * FROM pg_catalog.pg_tables
2) show databases <==> \l
Or use the select sentence:
select datname from pg_database;
3) Delete all the rows of a table:
DELETE FROM tablename;
If you need to have a filter:
DELETE FROM weather WHERE city = 'Hayward';
4) Switch to another dataset
\c databasename
相关文章推荐
- postgre drop所有table的语句
- PgSQL · 答疑解惑 · PostgreSQL 用户组权限管理
- PostgreSQL学习手册(服务器配置)
- postgre数据库
- 数据库事务
- PostgreSQL学习手册(性能提升技巧)
- PostgreSQL学习手册(事物隔离)
- PostgreSQL学习手册(函数和操作符<三>)
- PostgreSQL学习手册(函数和操作符<二>)
- PostgreSQL(表的继承和分区)
- PostgreSQL学习手册(数据类型)
- PostgreSQL学习手册(模式schema)
- PostgreSQL学习手册(数据表)
- Linux使用终端安装postgre
- 用客户端命令psql连接 PostgreSQL 不输入密码的方法
- postgreSQL入门01-安装
- mysql的一些表操作
- postgre数据库函数
- postgres批量新建索引
- PostgreSQL 数据库的备份