postgresql常用命令

2021-09-29 05:13:52 字數 695 閱讀 8659

環境 :ubuntu 16.04 lts

資料庫版本 :9.6.6

注意 :postgresql中的不同型別的許可權有select,insert,update,delete,truncate,references,trigger,create,connect,temporary,execute 和 usage。

以管理員身份 postgres 登陸,然後通過

#psql -u postgres

#sudo -i -u postgres

$ psql xc_hzh_linan #登入xc_hzh_linan資料庫

$ psql -u postgres test #以postgres使用者身份,登入test資料庫

psql -h localhost -p 5432 -u postgress testdb

介面效果為:

postgres@ubuntu

:~$ psql

psql (9.5.19)

type "help" for help.

postgres=#

簡單說一下pgsql 的相關命令

使用反斜線作為命令前

postgresql常用命令

最近一直在學習postgresql,下面是自己整理的postgresql的常用命令 連線資料庫,預設的使用者和資料庫是postgres psql u user d dbname 切換資料庫,相當於mysql的use dbname c dbname 列舉資料庫,相當於mysql的show databa...

postgresql常用命令

最近一直在學習postgresql,下面是自己整理的postgresql的常用命令 連線資料庫,預設的使用者和資料庫是postgres psql u user d dbname 切換資料庫,相當於mysql的use dbname c dbname 列舉資料庫,相當於mysql的show databa...

postgresql常用命令

最近一直在學習postgresql,下面是自己整理的postgresql的常用命令 連線資料庫,預設的使用者和資料庫是postgres psql u user d dbname 切換資料庫,相當於mysql的use dbname c dbname 列舉資料庫,相當於mysql的show databa...