hi samizdat-devel,
createuser in postgresql 7.4.7 has -A instead of -S and does
not have -R
IMHO it would be better that the database creation script
has a fallback
option in case the user does not have a relatively recent
version
of postgresql.
So in this patch, i've put createuser -AD as a fallback
option in case
createuser -SDR fails.
It's not perfect, and not good enough for this to be part of
a full
debian install, because if the fallback happens, then
although the
sysadmin installing will end up with a postgres database and
user, a
careful novice sysadmin might become (unnecessarily)
concerned about the error
message given out due to the failure of createuser -SDR.
Some people *do*
actually read error messages and worry about them...
(On the other hand, i understand why the -SDR options were
introduced - partly
in response to my questions as a novice concerned about what
to answer to
the questions about what privileges the user should have.)
Anyway, here's the patch.
cheers
boud
---
/scratch2/boud/samizdat_cvs/sources/samizdat/bin/samizdat-cr
eate-database 2006-11-27 09:28:41.000000000 +0100
+++ samizdat-create-database 2007-01-31 22:03:36.980417464
+0100
 -45,7
+45,7 
exit 3
fi
echo "Creating database and user..."
- su -c "createdb --encoding UNICODE '$SITE'
&& createlang plpgsql '$SITE' && createuser
-SDR '$SITE'" - postgres
+ su -c "createdb --encoding UNICODE '$SITE'
&& createlang plpgsql '$SITE' && (createuser
-SDR '$SITE' || createuser -AD '$SITE')" - postgres
echo "Generating database schema..."
echo "$SQL" | su -c "psql -q '$SITE'
2>/dev/null" - postgres
echo
_______________________________________________
samizdat-devel mailing list
samizdat-devel nongnu.org
http://lists.nongnu.org/mailman/listinfo/samizdat-devel
a>
|