Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
c97f6fd1
Commit
c97f6fd1
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Add "-D location" to specify alternate database location.
parent
75d5ce28
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/createdb/createdb.sh
+45
-25
45 additions, 25 deletions
src/bin/createdb/createdb.sh
with
45 additions
and
25 deletions
src/bin/createdb/createdb.sh
+
45
−
25
View file @
c97f6fd1
...
...
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
6
199
6
/11/
1
7 0
3:54:44 bryanh
Exp $
# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.
7
199
7
/11/
0
7 0
6:25:25 thomas
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -34,14 +34,23 @@ dbname=$USER
while
test
-n
"
$1
"
do
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
=
""
else
...
...
@@ -60,7 +69,18 @@ else
PGPORTOPT
=
"-p
$PGPORT
"
fi
psql
-tq
$AUTHOPT
$PGHOSTOPT
$PGPORTOPT
-c
"create database
$dbname
"
template1
if
[
-z
"
$dbpath
"
]
;
then
location
=
""
else
# 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
$location
"
template1
if
[
$?
-ne
0
]
;
then
echo
"
$CMDNAME
: database creation failed on
$dbname
."
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment