pg數(shù)據(jù)庫為什么不火 如何查PostgreSQL數(shù)據(jù)庫中所有的表?
如何查PostgreSQL數(shù)據(jù)庫中所有的表?1、通過命令行查詢 d 數(shù)據(jù)庫 —— 得到所有表的名字 d 表名 —— 得到表結(jié)構(gòu) 2、通過SQL語句查詢 "select * fr
如何查PostgreSQL數(shù)據(jù)庫中所有的表?
1、通過命令行查詢 d 數(shù)據(jù)庫 —— 得到所有表的名字 d 表名 —— 得到表結(jié)構(gòu) 2、通過SQL語句查詢 "select * from pg_tables" —— 得到當(dāng)前db中所有表的信息(這里pg_tables是系統(tǒng)視圖) "select tablename from pg_tables where schemaname="public"" —— 得到所有用戶自定義表的名字(這里"tablename"字段是表的名字,"schemaname"是schema的名字。用戶自定義的表,如果未經(jīng)特殊處理,默認(rèn)都是放在名為public的schema下)
postgresql怎么還原數(shù)據(jù)庫?
還原需要原先對數(shù)據(jù)庫進(jìn)行過備份,才能從備份恢復(fù),如果沒有備份過,那是無法還原的。恢復(fù)數(shù)據(jù)庫,指令如下: pg_restore.exe --host localhost --port 5432 --username "postgres" --dbname "symbolmcnew" --no-password --verbose "databasename.backup"指令解釋:如上命令,psql是恢復(fù)數(shù)據(jù)庫命令,localhost是要恢復(fù)到哪個數(shù)據(jù)庫的地址,當(dāng)然你可以寫上ip地址,也就是說能遠(yuǎn)程恢復(fù)(必須保證 數(shù)據(jù)庫允許外部訪問的權(quán)限哦~);postgres 就是要恢復(fù)到哪個數(shù)據(jù)庫的用戶;symbolmcnew 是要恢復(fù)到哪個數(shù)據(jù)庫,databasename.backup指備份文件。