0
点赞
收藏
分享

微信扫一扫

pgsql 相关的命令


登录:

 psql -h 127.0.0.1 -U username

输入口令(即密码):

test=> select datname from pg_database;
datname
------------------------
template1
template0
postgres
sskp_11_0
sskp_41_0
(5 行记录)

test=> use fwkp_410104999999306_0;
错误: 语法错误 在 "use" 或附近的
第1行use fwkp_410104999999306_0;
^
test=>

查看所有的数据库 show databases  ----->select datname from pg_database

使用数据库: -----use databasename ------>\c   databasename

test=> \c fwkp_41_0 
您现在已经连线到数据库 "sskp_41_0",用户 "test".

show tables------>SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
table_name

fwkp_410104999999306_0=> show tables;
错误: 未认可的配置参数 "tables"
sskp_41_0=> SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
table_name
---------------
oilkc
oillg_lsxx
bm_spfl
errmsg

(3行记录)

 

举报

相关推荐

0 条评论