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
a54ba521
Commit
a54ba521
authored
26 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Properly interpret environment variables passed as the input location.
parent
86234a09
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/initlocation/initlocation.sh
+11
-7
11 additions, 7 deletions
src/bin/initlocation/initlocation.sh
with
11 additions
and
7 deletions
src/bin/initlocation/initlocation.sh
+
11
−
7
View file @
a54ba521
...
...
@@ -12,11 +12,12 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.
1
199
7
/1
1
/0
7
0
6:21:39
thomas Exp $
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.
2
199
8
/1
0
/0
5
0
2:51:21
thomas Exp $
#
#-------------------------------------------------------------------------
CMDNAME
=
`
basename
$0
`
POSTGRES_SUPERUSERNAME
=
$USER
while
[
"$#"
-gt
0
]
do
...
...
@@ -48,6 +49,13 @@ fi
# Make sure he told us where to build the database area
#-------------------------------------------------------------------------
PGENVAR
=
"
$PGALTDATA
"
PGENVAR
=
`
printenv
$PGENVAR
`
if
[
!
-z
"
$PGENVAR
"
]
;
then
PGALTDATA
=
$PGENVAR
echo
"
$CMDNAME
: input argument points to
$PGALTDATA
"
fi
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"
...
...
@@ -58,11 +66,6 @@ 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 "
...
...
@@ -91,7 +94,6 @@ 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
...
...
@@ -105,12 +107,14 @@ if [ ! -d $PGALTDATA ]; then
echo
mkdir
$PGALTDATA
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
chown
$POSTGRES_SUPERUSERNAME
$PGALTDATA
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
chown
$POSTGRES_SUPERUSERNAME
$PGALTDATA
/base
fi
exit
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