postgres
连接数据库, 默认的用户和数据库是postgres
psql -U user -d dbname
切换数据库,相当于mysql的use dbname
\c dbname
列举数据库,相当于mysql的show databases
\l
列举表,相当于mysql的show tables
\dt
查看表结构,相当于desc tblname,show columns from tbname
\d tblname
\di 查看索引
创建数据库:
create database [数据库名];
删除数据库:
drop database [数据库名];
*重命名一个表:
alter table [表名A] rename to [表名B];
*删除一个表:
drop table [表名];
ps aux | grep postgres
psql postgres
数据还原
bunzip2 -c huafei3_development.bz2 | psql <OPTIONS> template1
备份:
pg_dump -h qa.fun-guide.mobi -U pgsql huafei_development > huafeibak.out
psql -h localhost -U postgres -d huafei_development < huafeibak.out
http://my.oschina.net/zhao/blog/55071
桥接
bjv1db tunnel
Host bjv1db
HostName 119.90.35.166
User root
Port 1022
identityfile ~/.ssh/funguide key
ServerAliveInterval 10
LocalForward 5435 localhost:5432
localForward 本地端口 远端端口
超级用户密码丢失, 卸载重新安装
rm -rf /usr/local/var/postgres
rm -rf /usr/local/opt/postgresql
rm -rf /usr/local/bin/postgres
rm -rf /usr/local/Cellar/postgresql
rm -rf /usr/local/share/postgresql
rm -rf /usr/local/include/postgres_ext.h
brew uninstall postgresql
brew install postgresql
brew unlink postgresql
brew link --overwrite postgresql
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
createuser -s -r postgres
psql -U postgres
ALTER USER menxu WITH PASSWORD '';
~: su menxu 系统用户和数据库用户是分开的
Password:
/Users/menxu/.rvm/scripts/initialize:44: __rvm_cleanse_variables: function definition file not found
/Users/menxu/.rvm/scripts/initialize:46: command not found: rvm_error
应该是用这种方式登陆用户不会运行shell的设置脚本
分享到:
相关推荐
Create a usable and attractive login form using Bootstrap's styles, while ensuring the database table backing it is secure using Postgres' check constraints. See how creating an advanced Postgres ...
postgres_v9.6.8 arm架构 国产操作系统 欧拉操作系统 eulerOS 免安装版本postgres,开箱即用 启动方式:./bin/pg_ctl -D data -l logfile start 默认用户名密码:postgres、ft@135246,也可重命名data目录后执行./...
Postgres Plus Advanced Server EnterpriseDB核心数据库安装包 edb connectors --为EnterpriseDB提供odbc及c#等开发环境的数据库访问接口 edb migration studio --从其他主流DBMS将数据平滑迁移至EnterpriseDB的...
postgres 代码生成器,自动生成3层结构。
本资源使用python进行编写,解压后在pycharm中进行使用,该探查数据库适用于postgres数据库,运行结束后以.xlsx格式进行保存,探查的内容有:数据库名称、数据表名称、数据表注释、排序、字段名称、字段注释、字段...
针对两台服务器下的postgres数据库之间,实现无密码互相登录
从mysql数据库迁移到postgres数据库转换ddl语句的工具,添加了自动更新时间的触发器。
曾经风靡一时的MPP解决方案Greenplum是基于postgres-xl的8.2版本封装的,已经停止更新,逐渐被Postgres-XL新版本取代。 Postgres-XL是开源的postgresql集群,是由多个独立的PostgreSQL实例组成,它们分布在不同的...
postgres数据库linux版本
centos7下Postgres13安装包带依赖,附安装脚本
postgres_exporter-0.9.0.linux-amd64.tar.gz
PostgresSQL是一个很优秀的开源数据库,并提供了针对空间数据的存扩展;这个PPT介绍了PostgresSQL数据库的基本情况
postgres驱动程序
postgres中文文档!
flink-connector-postgres-cdc-1.4.0.jar
postgressql 连接数据库 和关闭数据库
Linux下postgres安装说明
flink cdc postgres 数据同步 jar包,2021年最新版
PostgresSQL的简明教程,里面包含了使用方法
suse postgres 开机启动