Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
ff50e5ab
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff50e5ab
编写于
7月 25, 1996
作者:
M
Marc G. Fournier
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Switched from using monitor to using psql
Submitted by: Rick Weldon <rick@wisetech.com>
上级
69ee15d6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
19 deletion
+20
-19
src/bin/createdb/createdb.sh
src/bin/createdb/createdb.sh
+2
-2
src/bin/createuser/createuser.sh
src/bin/createuser/createuser.sh
+7
-7
src/bin/destroydb/destroydb.sh
src/bin/destroydb/destroydb.sh
+2
-2
src/bin/destroyuser/destroyuser.sh
src/bin/destroyuser/destroyuser.sh
+9
-8
未找到文件。
src/bin/createdb/createdb.sh
浏览文件 @
ff50e5ab
...
...
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
1.1.1 1996/07/09 06:22:12
scrappy Exp $
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
2 1996/07/25 06:55:23
scrappy Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -58,7 +58,7 @@ done
AUTHOPT
=
"-a
$AUTHSYS
"
[
-z
"
$AUTHSYS
"
]
&&
AUTHOPT
=
""
monitor
-TN
$AUTHOPT
-h
$PGHOST
-p
$PGPORT
-c
"create database
$dbname
"
template1
||
{
psql
-Tq
$AUTHOPT
-H
$PGHOST
-p
$PGPORT
-c
"create database
$dbname
"
template1
||
{
echo
"
$CMDNAME
: database creation failed on
$dbname
."
exit
1
}
...
...
src/bin/createuser/createuser.sh
浏览文件 @
ff50e5ab
...
...
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.
1.1.1 1996/07/09 06:22:12
scrappy Exp $
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.
2 1996/07/25 06:55:30
scrappy Exp $
#
# Note - this should NOT be setuid.
#
...
...
@@ -55,13 +55,13 @@ done
AUTHOPT
=
"-a
$AUTHSYS
"
[
-z
"
$AUTHSYS
"
]
&&
AUTHOPT
=
""
MARGS
=
"-TN
$AUTHOPT
-h
$PGHOST
-p
$PGPORT
"
PARGS
=
"-T -q
$AUTHOPT
-H
$PGHOST
-p
$PGPORT
"
#
# generate the first part of the actual monitor command
#
MONITOR
=
"monitor
$M
ARGS
"
PSQL
=
"psql
$P
ARGS
"
#
# see if user $USER is allowed to create new users
...
...
@@ -70,7 +70,7 @@ MONITOR="monitor $MARGS"
QUERY
=
"select usesuper from pg_user where usename = '
$USER
'"
#echo $QUERY
ADDUSER
=
`
$
MONITOR
-TN
-c
"
$QUERY
"
template1
`
ADDUSER
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
...
...
@@ -100,7 +100,7 @@ fi
QUERY
=
"select usesysid from pg_user where usename = '
$NEWUSER
'"
RES
=
`
$
MONITOR
-TN
-c
"
$QUERY
"
template1
`
RES
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
...
...
@@ -142,7 +142,7 @@ do
exit
1
fi
QUERY
=
"select usename from pg_user where usesysid = '
$SYSID
'::int4"
RES
=
`
$
MONITOR
-TN
-c
"
$QUERY
"
template1
`
RES
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
echo
"
$CMDNAME
: database access failed."
...
...
@@ -206,7 +206,7 @@ QUERY="insert into pg_user \
values
\
('
$NEWUSER
',
$SYSID
, '
$CANCREATE
', 't', '
$CANADDUSER
','t')"
RES
=
`
$
MONITOR
-TN
-c
"
$QUERY
"
template1
`
RES
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
#
# Wrap things up. If the user was created successfully, AND the user was
...
...
src/bin/destroydb/destroydb.sh
浏览文件 @
ff50e5ab
...
...
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/destroydb.sh,v 1.
1.1.1 1996/07/09 06:22:12
scrappy Exp $
# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/destroydb.sh,v 1.
2 1996/07/25 06:55:41
scrappy Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -58,7 +58,7 @@ done
AUTHOPT
=
"-a
$AUTHSYS
"
[
-z
"
$AUTHSYS
"
]
&&
AUTHOPT
=
""
monitor
-TN
-h
$PGHOST
-p
$PGPORT
-c
"drop database
$dbname
"
template1
psql
-Tq
-H
$PGHOST
-p
$PGPORT
-c
"drop database
$dbname
"
template1
if
[
$?
-ne
0
]
then
...
...
src/bin/destroyuser/destroyuser.sh
浏览文件 @
ff50e5ab
...
...
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.
1.1.1 1996/07/09 06:22:12
scrappy Exp $
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.
2 1996/07/25 06:55:49
scrappy Exp $
#
# Note - this should NOT be setuid.
#
...
...
@@ -55,12 +55,13 @@ done
AUTHOPT
=
"-a
$AUTHSYS
"
[
-z
"
$AUTHSYS
"
]
&&
AUTHOPT
=
""
MARGS
=
"-TN
$AUTHOPT
-p
$PGPORT
-h
$PGHOST
"
PARGS
=
"-Tq
$AUTHOPT
-p
$PGPORT
-H
$PGHOST
"
#
# generate the first part of the actual monitor command
#
MONITOR
=
"monitor
$MARGS
"
PSQL
=
"psql
$PARGS
"
#
# see if user $USER is allowed to create new users. Only a user who can
...
...
@@ -68,7 +69,7 @@ MONITOR="monitor $MARGS"
#
QUERY
=
"select usesuper from pg_user where usename = '
$USER
'"
ADDUSER
=
`
$
MONITOR
-c
"
$QUERY
"
template1
`
ADDUSER
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
...
...
@@ -93,7 +94,7 @@ fi
QUERY
=
"select usesysid from pg_user where usename = '
$DELUSER
'"
RES
=
`
$
MONITOR
-c
"
$QUERY
"
template1
`
RES
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
...
...
@@ -117,7 +118,7 @@ SYSID=`echo $RES | sed 's/ //g'`
QUERY
=
"select datname from pg_database where datdba = '
$SYSID
'::oid"
ALLDBS
=
`
$
MONITOR
-c
"
$QUERY
"
template1
`
ALLDBS
=
`
$
PSQL
-c
"
$QUERY
"
template1
`
if
[
$?
-ne
0
]
then
...
...
@@ -170,7 +171,7 @@ then
echo
"destroying database
$i
"
QUERY
=
"drop database
$i
"
$
MONITOR
-c
"
$QUERY
"
template1
$
PSQL
-c
"
$QUERY
"
template1
if
[
$?
-ne
0
]
then
echo
"
$CMDNAME
: drop database on
$i
failed - exiting"
...
...
@@ -181,7 +182,7 @@ fi
QUERY
=
"delete from pg_user where usename = '
$DELUSER
'"
$
MONITOR
-c
"
$QUERY
"
template1
$
PSQL
-c
"
$QUERY
"
template1
if
[
$?
-ne
0
]
then
echo
"
$CMDNAME
: delete of user
$DELUSER
was UNSUCCESSFUL"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录