Postgres 技巧,postgres技巧
在業務量大的時候 碰到需要添加索引,需要用到 CONCURRENTLY,不然你的庫很容易會壞的
如
create index CONCURRENTLY idx_order_records_bank_statist_uid on order_records(statist_uid)
見
http://www.postgresql.org/docs/9.1/static/sql-createindex.html
在大的業務量下,如果你要去執行一些費時耗資料庫的任務 有時會發現 某一個任務 還在暗地裡執行著 需要我們 手動的 關閉 該任務
如果你是 kill 對應的pid ,那麼你玩了,你很有可能會出現 資料庫的問題
保險的做法是 用 PG_CANCEL_BACKEND
通過 如下尋找對應的PID
select pid, trim(starttime) as start, duration, trim(user_name) as user,substring (query,1,40) as querytxtfrom stv_recentswhere status = 'Running';
查看
select pg_cancel_backend(802);
通過如下 殺掉 任務
pg_cancel_backend( pid )
http://docs.aws.amazon.com/redshift/latest/dg/PG_CANCEL_BACKEND.html
postgres問題
1 bossjzl17 回答了命令列解決辦法
2 可以使用圖形化用戶端工具pgadmin來協助你解決
在windows上安裝PostgreSQL的時候選擇上pgadmin。
如果PostgreSQL 是安裝在Linux上的話,需要單獨安裝pgadmin用戶端的。
也可以在windows上安裝pgadmin用戶端,串連linux。
pgadmin 有匯入匯出的嚮導,
如果對您有協助,請記得採納為滿意答案,謝謝!祝您生活愉快!
vaela
postgres安裝問題
完全刪了再裝 安裝出錯 不可能是DB的問題 大部分是系統內容的問題