Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d7d51bc1
Commit
d7d51bc1
authored
Jan 21, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put quotes around environment variables.
parent
11d9d2cf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
31 deletions
+31
-31
src/bin/scripts/createdb
src/bin/scripts/createdb
+10
-10
src/bin/scripts/createlang.sh
src/bin/scripts/createlang.sh
+5
-5
src/bin/scripts/createuser
src/bin/scripts/createuser
+10
-10
src/bin/scripts/droplang
src/bin/scripts/droplang
+4
-4
src/bin/scripts/dropuser
src/bin/scripts/dropuser
+2
-2
No files found.
src/bin/scripts/createdb
View file @
d7d51bc1
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.1
2 2000/11/25 19:05:44 petere
Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.1
3 2001/01/21 05:16:45 momjian
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -73,19 +73,19 @@ do
...
@@ -73,19 +73,19 @@ do
dbpath
=
"
$2
"
dbpath
=
"
$2
"
shift
;;
shift
;;
-D
*
)
-D
*
)
dbpath
=
`
echo
$1
|
sed
's/^-D//'
`
dbpath
=
`
echo
"
$1
"
|
sed
's/^-D//'
`
;;
;;
--location
=
*
)
--location
=
*
)
dbpath
=
`
echo
$1
|
sed
's/^--location=//'
`
dbpath
=
`
echo
"
$1
"
|
sed
's/^--location=//'
`
;;
;;
--encoding
|
-E
)
--encoding
|
-E
)
MB
=
$2
MB
=
"
$2
"
shift
;;
shift
;;
-E
*
)
-E
*
)
MB
=
`
echo
$1
|
sed
's/^-E//'
`
MB
=
`
echo
"
$1
"
|
sed
's/^-E//'
`
;;
;;
--encoding
=
*
)
--encoding
=
*
)
MB
=
`
echo
$1
|
sed
's/^--encoding=//'
`
MB
=
`
echo
"
$1
"
|
sed
's/^--encoding=//'
`
;;
;;
-
*
)
-
*
)
echo
"
$CMDNAME
: invalid option:
$1
"
1>&2
echo
"
$CMDNAME
: invalid option:
$1
"
1>&2
...
@@ -138,7 +138,7 @@ fi
...
@@ -138,7 +138,7 @@ fi
if
[
-z
"
$dbname
"
]
;
then
if
[
-z
"
$dbname
"
]
;
then
if
[
"
$PGUSER
"
]
;
then
if
[
"
$PGUSER
"
]
;
then
dbname
=
$PGUSER
dbname
=
"
$PGUSER
"
else
else
dbname
=
`
${
PATHNAME
}
pg_id
-u
-n
`
dbname
=
`
${
PATHNAME
}
pg_id
-u
-n
`
fi
fi
...
@@ -147,8 +147,8 @@ fi
...
@@ -147,8 +147,8 @@ fi
# escape the quotes
# escape the quotes
dbpath
=
`
echo
$dbpath
|
sed
"s/'/
\\\\\'
/g"
`
dbpath
=
`
echo
"
$dbpath
"
|
sed
"s/'/
\\\\\'
/g"
`
dbname
=
`
echo
$dbname
|
sed
's/\"/\\\"/g'
`
dbname
=
`
echo
"
$dbname
"
|
sed
's/\"/\\\"/g'
`
withstring
=
withstring
=
[
"
$dbpath
"
]
&&
withstring
=
"
$withstring
LOCATION = '
$dbpath
'"
[
"
$dbpath
"
]
&&
withstring
=
"
$withstring
LOCATION = '
$dbpath
'"
...
@@ -164,7 +164,7 @@ fi
...
@@ -164,7 +164,7 @@ fi
# Insert comment as well, if requested
# Insert comment as well, if requested
[
-z
"
$dbcomment
"
]
&&
exit
0
[
-z
"
$dbcomment
"
]
&&
exit
0
dbcomment
=
`
echo
$dbcomment
|
sed
"s/'/
\\\\\'
/g"
`
dbcomment
=
`
echo
"
$dbcomment
"
|
sed
"s/'/
\\\\\'
/g"
`
${
PATHNAME
}
psql
$PSQLOPT
-d
template1
-c
"COMMENT ON DATABASE
\"
$dbname
\"
IS '
$dbcomment
'"
${
PATHNAME
}
psql
$PSQLOPT
-d
template1
-c
"COMMENT ON DATABASE
\"
$dbname
\"
IS '
$dbcomment
'"
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
...
...
src/bin/scripts/createlang.sh
View file @
d7d51bc1
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.2
1 2000/11/25 19:05:44 petere
Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.2
2 2001/01/21 05:16:45 momjian
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -81,20 +81,20 @@ do
...
@@ -81,20 +81,20 @@ do
dbname
=
"
$2
"
dbname
=
"
$2
"
shift
;;
shift
;;
-d
*
)
-d
*
)
dbname
=
`
echo
$1
|
sed
's/^-d//'
`
dbname
=
`
echo
"
$1
"
|
sed
's/^-d//'
`
;;
;;
--dbname
=
*
)
--dbname
=
*
)
dbname
=
`
echo
$1
|
sed
's/^--dbname=//'
`
dbname
=
`
echo
"
$1
"
|
sed
's/^--dbname=//'
`
;;
;;
# misc options
# misc options
--pglib
|
-L
)
--pglib
|
-L
)
PGLIB
=
"
$2
"
PGLIB
=
"
$2
"
shift
;;
shift
;;
-L
*
)
-L
*
)
PGLIB
=
`
echo
$1
|
sed
's/^-L//'
`
PGLIB
=
`
echo
"
$1
"
|
sed
's/^-L//'
`
;;
;;
--pglib
=
*
)
--pglib
=
*
)
PGLIB
=
`
echo
$1
|
sed
's/^--pglib=//'
`
PGLIB
=
`
echo
"
$1
"
|
sed
's/^--pglib=//'
`
;;
;;
-
*
)
-
*
)
...
...
src/bin/scripts/createuser
View file @
d7d51bc1
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.1
5 2000/11/25 19:05:44 petere
Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.1
6 2001/01/21 05:16:45 momjian
Exp $
#
#
# Note - this should NOT be setuid.
# Note - this should NOT be setuid.
#
#
...
@@ -97,13 +97,13 @@ do
...
@@ -97,13 +97,13 @@ do
CanAddUser
=
f
CanAddUser
=
f
;;
;;
--sysid
|
-i
)
--sysid
|
-i
)
SysID
=
$2
SysID
=
"
$2
"
shift
;;
shift
;;
--sysid
=
*
)
--sysid
=
*
)
SysID
=
`
echo
$1
|
sed
's/^--sysid=//'
`
SysID
=
`
echo
"
$1
"
|
sed
's/^--sysid=//'
`
;;
;;
-i
*
)
-i
*
)
SysID
=
`
echo
$1
|
sed
's/^-i//'
`
SysID
=
`
echo
"
$1
"
|
sed
's/^-i//'
`
;;
;;
--pwprompt
|
--pw
|
-P
)
--pwprompt
|
--pw
|
-P
)
PwPrompt
=
t
PwPrompt
=
t
...
@@ -114,7 +114,7 @@ do
...
@@ -114,7 +114,7 @@ do
exit
1
exit
1
;;
;;
*
)
*
)
NewUser
=
$1
NewUser
=
"
$1
"
;;
;;
esac
esac
shift
;
shift
;
...
@@ -182,14 +182,14 @@ if [ "$PwPrompt" ]; then
...
@@ -182,14 +182,14 @@ if [ "$PwPrompt" ]; then
echo
"Passwords didn't match."
1>&2
echo
"Passwords didn't match."
1>&2
exit
1
exit
1
fi
fi
Password
=
$FirstPw
Password
=
"
$FirstPw
"
fi
fi
if
[
-z
"
$CanCreateDb
"
]
;
then
if
[
-z
"
$CanCreateDb
"
]
;
then
$ECHO_N
"Shall the new user be allowed to create databases? (y/n) "
$ECHO_C
$ECHO_N
"Shall the new user be allowed to create databases? (y/n) "
$ECHO_C
read
REPLY
read
REPLY
[
$?
-ne
0
]
&&
exit
1
[
$?
-ne
0
]
&&
exit
1
if
[
$REPLY
=
"y"
-o
$REPLY
=
"Y"
]
;
then
if
[
"
$REPLY
"
=
"y"
-o
"
$REPLY
"
=
"Y"
]
;
then
CanCreateDb
=
t
CanCreateDb
=
t
else
else
CanCreateDb
=
f
CanCreateDb
=
f
...
@@ -200,7 +200,7 @@ if [ -z "$CanAddUser" ]; then
...
@@ -200,7 +200,7 @@ if [ -z "$CanAddUser" ]; then
$ECHO_N
"Shall the new user be allowed to create more new users? (y/n) "
$ECHO_C
$ECHO_N
"Shall the new user be allowed to create more new users? (y/n) "
$ECHO_C
read
REPLY
read
REPLY
[
$?
-ne
0
]
&&
exit
1
[
$?
-ne
0
]
&&
exit
1
if
[
$REPLY
=
"y"
-o
$REPLY
=
"Y"
]
;
then
if
[
"
$REPLY
"
=
"y"
-o
"
$REPLY
"
=
"Y"
]
;
then
CanAddUser
=
t
CanAddUser
=
t
else
else
CanAddUser
=
f
CanAddUser
=
f
...
@@ -211,8 +211,8 @@ fi
...
@@ -211,8 +211,8 @@ fi
#
#
# build SQL command
# build SQL command
#
#
NewUser
=
`
echo
$NewUser
|
sed
's/\"/\\\"/g'
`
NewUser
=
`
echo
"
$NewUser
"
|
sed
's/\"/\\\"/g'
`
Password
=
`
echo
$Password
|
sed
's/\"/\\\"/g'
`
Password
=
`
echo
"
$Password
"
|
sed
's/\"/\\\"/g'
`
QUERY
=
"CREATE USER
\"
$NewUser
\"
"
QUERY
=
"CREATE USER
\"
$NewUser
\"
"
...
...
src/bin/scripts/droplang
View file @
d7d51bc1
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.1
1 2000/11/25 19:05:44 petere
Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.1
2 2001/01/21 05:16:45 momjian
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -81,10 +81,10 @@ do
...
@@ -81,10 +81,10 @@ do
dbname
=
"
$2
"
dbname
=
"
$2
"
shift
;;
shift
;;
-d
*
)
-d
*
)
dbname
=
`
echo
$1
|
sed
's/^-d//'
`
dbname
=
`
echo
"
$1
"
|
sed
's/^-d//'
`
;;
;;
--dbname
=
*
)
--dbname
=
*
)
dbname
=
`
echo
$1
|
sed
's/^--dbname=//'
`
dbname
=
`
echo
"
$1
"
|
sed
's/^--dbname=//'
`
;;
;;
-
*
)
-
*
)
...
@@ -203,7 +203,7 @@ if [ $? -ne 0 ]; then
...
@@ -203,7 +203,7 @@ if [ $? -ne 0 ]; then
echo
"
$CMDNAME
: external error"
1>&2
echo
"
$CMDNAME
: external error"
1>&2
exit
1
exit
1
fi
fi
if
[
$res
-ne
0
]
;
then
if
[
"
$res
"
-ne
0
]
;
then
echo
"
$CMDNAME
: There are
$res
functions/trigger procedures declared in language"
1>&2
echo
"
$CMDNAME
: There are
$res
functions/trigger procedures declared in language"
1>&2
echo
"
$lancomp
. Language not removed."
1>&2
echo
"
$lancomp
. Language not removed."
1>&2
exit
1
exit
1
...
...
src/bin/scripts/dropuser
View file @
d7d51bc1
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.1
0 2000/11/25 19:05:44 petere
Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.1
1 2001/01/21 05:16:45 momjian
Exp $
#
#
# Note - this should NOT be setuid.
# Note - this should NOT be setuid.
#
#
...
@@ -134,7 +134,7 @@ if [ "$forcedel" = f ]; then
...
@@ -134,7 +134,7 @@ if [ "$forcedel" = f ]; then
fi
fi
DelUser
=
`
echo
$DelUser
|
sed
's/\"/\\\"/g'
`
DelUser
=
`
echo
"
$DelUser
"
|
sed
's/\"/\\\"/g'
`
${
PATHNAME
}
psql
$PSQLOPT
-d
template1
-c
"DROP USER
\"
$DelUser
\"
"
${
PATHNAME
}
psql
$PSQLOPT
-d
template1
-c
"DROP USER
\"
$DelUser
\"
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment