Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
utils
Commits
f45475b7
Commit
f45475b7
authored
Jul 30, 2017
by
Michał 'rysiek' Woźniak
Browse files
create_readonly_postgres_user: now more robust against certain weird outputs from psql
parent
9dd85de5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
utils.sh
utils.sh
+1
-1
No files found.
utils.sh
View file @
f45475b7
...
...
@@ -315,7 +315,7 @@ function create_readonly_postgres_user() {
||
{
display_error
"Error creating the
$RUSER_NAME
role and granting SELECT on pg_authid."
;
return
1
;
}
# get the list of roles
ROLES
=
"
$(
PGPASSWORD
=
"
$PG_PASS
"
psql
-h
"
$PG_HOST
"
-U
"
$PG_USER
"
-
A
qt
-c
'\dg'
postgres |
grep
'|'
|
cut
-d
'|'
-f
1
)
"
\
ROLES
=
"
$(
PGPASSWORD
=
"
$PG_PASS
"
psql
-h
"
$PG_HOST
"
-U
"
$PG_USER
"
-qt
-c
'\dg'
postgres |
grep
'|'
|
cut
-d
'|'
-f
1
|
tr
-d
' '
| egrep
-v
'^$'
)
"
\
||
{
display_error
"Error getting list of roles"
;
return
2
;
}
# and for each role
...
...
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