Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b5417a39
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,发现更多精彩内容 >>
提交
b5417a39
编写于
11月 07, 1997
作者:
T
Thomas G. Lockhart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Create alternate location(s) for databases.
上级
951986c5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
264 addition
and
0 deletion
+264
-0
src/bin/initlocation/Makefile
src/bin/initlocation/Makefile
+32
-0
src/bin/initlocation/initlocation
src/bin/initlocation/initlocation
+116
-0
src/bin/initlocation/initlocation.sh
src/bin/initlocation/initlocation.sh
+116
-0
未找到文件。
src/bin/initlocation/Makefile
0 → 100644
浏览文件 @
b5417a39
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/initlocation
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/Makefile,v 1.1 1997/11/07 06:21:34 thomas Exp $
#
#-------------------------------------------------------------------------
SRCDIR
=
../..
include
../../Makefile.global
SEDSCRIPT
=
\
-e
"s^_fUnKy_NAMEDATALEN_sTuFf_^
$(NAMEDATALEN)
^g"
\
-e
"s^_fUnKy_OIDNAMELEN_sTuFf_^
$(OIDNAMELEN)
^g"
all
:
initlocation
initlocation
:
initlocation.sh
cp
-p
initlocation.sh initlocation
install
:
initlocation
$(INSTALL)
$(INSTL_EXE_OPTS)
$<
$(DESTDIR)$(BINDIR)
/
$<
clean
:
rm
-f
initlocation
dep
:
src/bin/initlocation/initlocation
0 → 100644
浏览文件 @
b5417a39
#!/bin/sh
#-------------------------------------------------------------------------
#
# initarea.sh--
# Create (initialize) a secondary Postgres database storage area.
#
# A database storage area contains individual Postgres databases.
#
# To create the database storage area, we create a root directory tree.
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation,v 1.1 1997/11/07 06:21:38 thomas Exp $
#
#-------------------------------------------------------------------------
CMDNAME
=
`
basename
$0
`
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
--location
=
*
)
PGALTDATA
=
"
`
echo
$1
|
sed
's/^--pgdata=//'
`
"
;
;;
--username
=
*
)
POSTGRES_SUPERUSERNAME
=
"
`
echo
$1
|
sed
's/^--username=//'
`
"
;;
--location
)
shift
;
PGALTDATA
=
"
$1
"
;
;;
--username
)
shift
;
POSTGRES_SUPERUSERNAME
=
"
$1
"
;
;;
-u
)
shift
;
POSTGRES_SUPERUSERNAME
=
"
$1
"
;
;;
-D
)
shift
;
PGALTDATA
=
"
$1
"
;
;;
-
*
)
badparm
=
$1
;
usage
=
1
;
;;
*
)
PGALTDATA
=
"
$1
"
;
;;
esac
shift
done
if
[
!
-z
"
$badparm
"
]
;
then
echo
"
$CMDNAME
: Unrecognized parameter '
$badparm
'"
fi
if
[
!
-z
"
$usage
"
]
;
then
echo
"Usage:
$CMDNAME
[-u SUPERUSER] DATADIR"
exit
1
fi
#-------------------------------------------------------------------------
# Make sure he told us where to build the database area
#-------------------------------------------------------------------------
if
[
-z
"
$PGALTDATA
"
]
;
then
echo
"
$CMDNAME
: You must identify the target area, where the new data"
echo
"for this database system can reside. Do this with --location"
exit
1
fi
#---------------------------------------------------------------------------
# Figure out who the Postgres superuser for the new database system will be.
#---------------------------------------------------------------------------
if
[
1
-eq
0
]
;
then
if
[
-z
"
$POSTGRES_SUPERUSERNAME
"
]
;
then
$POSTGRES_SUPERUSERNAME
=
pg_id
fi
if
[
-z
"
$POSTGRES_SUPERUSERNAME
"
]
;
then
echo
"Can't tell what username to use. You don't have the USER"
echo
"environment variable set to your username and didn't specify the "
echo
"--username option"
exit
1
fi
POSTGRES_SUPERUID
=
`
pg_id
$POSTGRES_SUPERUSERNAME
`
if
[
$POSTGRES_SUPERUID
=
NOUSER
]
;
then
echo
"Valid username not given. You must specify the username for "
echo
"the Postgres superuser for the database system you are "
echo
"initializing, either with the --username option or by default "
echo
"to the USER environment variable."
exit
1
fi
if
[
$POSTGRES_SUPERUID
-ne
`
pg_id
`
-a
`
pg_id
`
-ne
0
]
;
then
echo
"Only the unix superuser may initialize a database with a different"
echo
"Postgres superuser. (You must be able to create files that belong"
echo
"to the specified unix user)."
exit
1
fi
echo
"We are initializing the database area with username"
\
"
$POSTGRES_SUPERUSERNAME
(uid=
$POSTGRES_SUPERUID
)."
echo
"This user will own all the files and must also own the server process."
echo
fi
# -----------------------------------------------------------------------
# Create the data directory if necessary
# -----------------------------------------------------------------------
# umask must disallow access to group, other for files and dirs
umask
077
if
[
!
-d
$PGALTDATA
]
;
then
echo
"Creating Postgres database system directory
$PGALTDATA
"
echo
mkdir
$PGALTDATA
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
if
[
!
-d
$PGALTDATA
/base
]
;
then
echo
"Creating Postgres database system directory
$PGALTDATA
/base"
echo
mkdir
$PGALTDATA
/base
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
exit
src/bin/initlocation/initlocation.sh
0 → 100644
浏览文件 @
b5417a39
#!/bin/sh
#-------------------------------------------------------------------------
#
# initarea.sh--
# Create (initialize) a secondary Postgres database storage area.
#
# A database storage area contains individual Postgres databases.
#
# To create the database storage area, we create a root directory tree.
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.1 1997/11/07 06:21:39 thomas Exp $
#
#-------------------------------------------------------------------------
CMDNAME
=
`
basename
$0
`
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
--location
=
*
)
PGALTDATA
=
"
`
echo
$1
|
sed
's/^--pgdata=//'
`
"
;
;;
--username
=
*
)
POSTGRES_SUPERUSERNAME
=
"
`
echo
$1
|
sed
's/^--username=//'
`
"
;;
--location
)
shift
;
PGALTDATA
=
"
$1
"
;
;;
--username
)
shift
;
POSTGRES_SUPERUSERNAME
=
"
$1
"
;
;;
-u
)
shift
;
POSTGRES_SUPERUSERNAME
=
"
$1
"
;
;;
-D
)
shift
;
PGALTDATA
=
"
$1
"
;
;;
-
*
)
badparm
=
$1
;
usage
=
1
;
;;
*
)
PGALTDATA
=
"
$1
"
;
;;
esac
shift
done
if
[
-n
"
$badparm
"
]
;
then
echo
"
$CMDNAME
: Unrecognized parameter '
$badparm
'"
fi
if
[
-n
"
$usage
"
]
;
then
echo
"Usage:
$CMDNAME
[-u SUPERUSER] DATADIR"
exit
1
fi
#-------------------------------------------------------------------------
# Make sure he told us where to build the database area
#-------------------------------------------------------------------------
if
[
-z
"
$PGALTDATA
"
]
;
then
echo
"
$CMDNAME
: You must identify the target area, where the new data"
echo
"for this database system can reside. Do this with --location"
exit
1
fi
#---------------------------------------------------------------------------
# Figure out who the Postgres superuser for the new database system will be.
#---------------------------------------------------------------------------
if
[
1
-eq
0
]
;
then
if
[
-z
"
$POSTGRES_SUPERUSERNAME
"
]
;
then
$POSTGRES_SUPERUSERNAME
=
pg_id
fi
if
[
-z
"
$POSTGRES_SUPERUSERNAME
"
]
;
then
echo
"Can't tell what username to use. You don't have the USER"
echo
"environment variable set to your username and didn't specify the "
echo
"--username option"
exit
1
fi
POSTGRES_SUPERUID
=
`
pg_id
$POSTGRES_SUPERUSERNAME
`
if
[
$POSTGRES_SUPERUID
=
NOUSER
]
;
then
echo
"Valid username not given. You must specify the username for "
echo
"the Postgres superuser for the database system you are "
echo
"initializing, either with the --username option or by default "
echo
"to the USER environment variable."
exit
1
fi
if
[
$POSTGRES_SUPERUID
-ne
`
pg_id
`
-a
`
pg_id
`
-ne
0
]
;
then
echo
"Only the unix superuser may initialize a database with a different"
echo
"Postgres superuser. (You must be able to create files that belong"
echo
"to the specified unix user)."
exit
1
fi
echo
"We are initializing the database area with username"
\
"
$POSTGRES_SUPERUSERNAME
(uid=
$POSTGRES_SUPERUID
)."
echo
"This user will own all the files and must also own the server process."
echo
fi
# -----------------------------------------------------------------------
# Create the data directory if necessary
# -----------------------------------------------------------------------
# umask must disallow access to group, other for files and dirs
umask
077
if
[
!
-d
$PGALTDATA
]
;
then
echo
"Creating Postgres database system directory
$PGALTDATA
"
echo
mkdir
$PGALTDATA
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
if
[
!
-d
$PGALTDATA
/base
]
;
then
echo
"Creating Postgres database system directory
$PGALTDATA
/base"
echo
mkdir
$PGALTDATA
/base
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
exit
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录