|
|
|
@ -94,14 +94,14 @@ public class PgUtil {
|
|
|
|
|
public static String READ = "SELECT";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
前期准备工作:
|
|
|
|
|
vi /usr/local/postgresql/data/pg_hba.conf
|
|
|
|
|
在文件末尾添上:
|
|
|
|
|
host all all 0.0.0.0/0 md5
|
|
|
|
|
# 参考:https://www.cnblogs.com/kgdxpr/p/17791946.html
|
|
|
|
|
#重启
|
|
|
|
|
su - pgsql
|
|
|
|
|
/usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l logfile restart
|
|
|
|
|
* 前期准备工作:
|
|
|
|
|
* vi /usr/local/postgresql/data/pg_hba.conf
|
|
|
|
|
* 在文件末尾添上:
|
|
|
|
|
* host all all 0.0.0.0/0 md5
|
|
|
|
|
* # 参考:https://www.cnblogs.com/kgdxpr/p/17791946.html
|
|
|
|
|
* #重启
|
|
|
|
|
* su - pgsql
|
|
|
|
|
* /usr/local/postgresql/bin/pg_ctl -D /usr/local/postgresql/data -l logfile restart
|
|
|
|
|
*/
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
//初始化
|
|
|
|
@ -128,7 +128,7 @@ public class PgUtil {
|
|
|
|
|
PgUtil.grantUserPrivilege(user_name, s, WRITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Record> list=PgUtil.getUserPrivilege(user_name);
|
|
|
|
|
List<Record> list = PgUtil.getUserPrivilege(user_name);
|
|
|
|
|
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
System.out.println(record);
|
|
|
|
|