postgres的一些基本命令**************************************************./psql-U postgresSELECT datname FROM pg_database;./psqlcas_data -U postgres用......
postgres的一些基本命令
**************************************************
./psql -U postgres
SELECT datname FROM pg_database;
./psql cas_data -U postgres 用户postgres进入cas_data数据库
\dt //显示所有数据表
select * from sc_data;
**************************************************
关于postgres远程访问的问题:
***************************************************
step 1 vi ../data/pg_hba.conf ,并且做如下修改。
# "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
step 2 重启postgres服务
su postgres
./pg_ctl stop -D ../data/ //停止服务
./pg_ctl start -D ../data/ //启动服务
***************************************************
参考文献
http://www.xxlinux.com/linux/article/development/database/20070820/9402.html postgres客户端常用命令
http://www.pgsqldb.org/mwiki/index.php/首页 postgresql中文之家
http://www.learndiary.com/archives/diaries/1856.htm 远程连接postgr
http://xinsoft.bokee.com/5374965.html 解决postgresql不能远程访问
|