You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
username=`$PSQL -d template1 -At -c"SELECT usename FROM pg_shadow WHERE usesysid =${userid};"`
204
+
echo"$GROLIST"| sed's/^{\(.*\)}$/\1/'| tr',''\n'|
205
+
whileread userid;do
206
+
username="`$PSQL -d template1 -At -c\"SELECT usename FROM pg_shadow WHERE usesysid =${userid};\"`"
203
207
echo" ALTER GROUP\"$GRONAME\" ADD USER\"$username\";"
204
208
done
205
209
done
206
210
207
-
208
211
test"$globals_only" = yes&&exit 0
209
212
210
213
@@ -218,10 +221,13 @@ exec 4<&0
218
221
# We skip databases marked not datallowconn, since we'd be unable to
219
222
# connect to them anyway (and besides, we don't want to dump template0).
220
223
221
-
$PSQL -d template1 -At -F'' \
222
-
-c"SELECT datname, coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn ORDER BY 1;"| \
' -c"SELECT datname, coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn ORDER BY 1;"| \
226
+
whileread DATABASE;do
227
+
read DBOWNER
228
+
read ENCODING
229
+
read ISTEMPLATE
230
+
read DBPATH
225
231
if ["$DATABASE"!= template1 ];then
226
232
echo
227
233
@@ -243,8 +249,8 @@ while read DATABASE DBOWNER ENCODING ISTEMPLATE DBPATH; do
243
249
fi
244
250
done
245
251
246
-
$PSQL -d template1 -At -F'' \
247
-
-c"SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;"| \
252
+
$PSQL -d template1 -At -F'
253
+
' -c"SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;"| \