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
c97f6fd1
Commit
c97f6fd1
authored
Nov 07, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "-D location" to specify alternate database location.
parent
75d5ce28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
25 deletions
+45
-25
src/bin/createdb/createdb.sh
src/bin/createdb/createdb.sh
+45
-25
No files found.
src/bin/createdb/createdb.sh
View file @
c97f6fd1
...
...
@@ -11,60 +11,80 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
6 1996/11/17 03:54:44 bryanh
Exp $
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
7 1997/11/07 06:25:25 thomas
Exp $
#
#-------------------------------------------------------------------------
CMDNAME
=
`
basename
$0
`
if
[
-z
"
$USER
"
]
;
then
if
[
-z
"
$LOGNAME
"
]
;
then
if
[
-z
"
`
whoami
`
"
]
;
then
echo
"
$CMDNAME
: cannot determine user name"
exit
1
if
[
-z
"
$LOGNAME
"
]
;
then
if
[
-z
"
`
whoami
`
"
]
;
then
echo
"
$CMDNAME
: cannot determine user name"
exit
1
fi
else
USER
=
$LOGNAME
export
USER
fi
else
USER
=
$LOGNAME
export
USER
fi
fi
dbname
=
$USER
while
test
-n
"
$1
"
do
case
$1
in
-a
)
AUTHSYS
=
$2
;
shift
;;
-h
)
PGHOST
=
$2
;
shift
;;
-p
)
PGPORT
=
$2
;
shift
;;
*
)
dbname
=
$1
;;
esac
shift
;
case
$1
in
--help
)
usage
=
1
;;
-a
)
AUTHSYS
=
$2
;
shift
;;
-h
)
PGHOST
=
$2
;
shift
;;
-p
)
PGPORT
=
$2
;
shift
;;
-D
)
dbpath
=
$2
;
shift
;;
-
*
)
echo
"
$CMDNAME
: unrecognized parameter
$1
"
;
usage
=
1
;;
*
)
dbname
=
$1
;;
esac
shift
;
done
if
[
"
$usage
"
]
;
then
echo
"Usage:
$CMDNAME
-a <authtype> -h <server> -p <portnumber> -D <location> [dbname]"
exit
1
fi
if
[
-z
"
$AUTHSYS
"
]
;
then
AUTHOPT
=
""
AUTHOPT
=
""
else
AUTHOPT
=
"-a
$AUTHSYS
"
AUTHOPT
=
"-a
$AUTHSYS
"
fi
if
[
-z
"
$PGHOST
"
]
;
then
PGHOSTOPT
=
""
PGHOSTOPT
=
""
else
PGHOSTOPT
=
"-h
$PGHOST
"
PGHOSTOPT
=
"-h
$PGHOST
"
fi
if
[
-z
"
$PGPORT
"
]
;
then
PGPORTOPT
=
""
PGPORTOPT
=
""
else
PGPORTOPT
=
"-p
$PGPORT
"
fi
if
[
-z
"
$dbpath
"
]
;
then
location
=
""
else
PGPORTOPT
=
"-p
$PGPORT
"
# if [ ! -d "$dbpath"/base ]; then
# echo "$CMDNAME: database creation failed on $dbname."
# echo "directory $dbpath/base not found."
# exit 1
# fi
location
=
"with location = '
$dbpath
'"
fi
psql
-tq
$AUTHOPT
$PGHOSTOPT
$PGPORTOPT
-c
"create database
$dbname
"
template1
psql
-tq
$AUTHOPT
$PGHOSTOPT
$PGPORTOPT
-c
"create database
$dbname
$location
"
template1
if
[
$?
-ne
0
]
;
then
echo
"
$CMDNAME
: database creation failed on
$dbname
."
exit
1
echo
"
$CMDNAME
: database creation failed on
$dbname
."
exit
1
fi
exit
0
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