From 105b768b410c6c232bf0b5b44801db95bfb56b07 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 25 Jun 2009 20:23:44 +0200 Subject: [PATCH] Add random pg stuff --- input/howto/postgres.creole | 26 ++++++++++++++++++++++++++ input/index.mdwn | 1 + 2 files changed, 27 insertions(+) create mode 100644 input/howto/postgres.creole diff --git a/input/howto/postgres.creole b/input/howto/postgres.creole new file mode 100644 index 0000000..35677e3 --- /dev/null +++ b/input/howto/postgres.creole @@ -0,0 +1,26 @@ +== User/permission stuff with pg == + +{{{ +revoke ALL on DATABASE "XXX" from public; + +grant CONNECT, CREATE, TEMPORARY on DATABASE "XXX" to "YYY"; +grant CONNECT on DATABASE "XXX" to public; +grant TEMPORARY on DATABASE "XXX" to guest; + +REVOKE ALL ON SCHEMA public from public; +GRANT USAGE ON SCHEMA public TO public; +GRANT ALL ON SCHEMA public TO "YYY"; + +\dn+ +\dp+ + +select * from pg_database ; + + + +sudo -u postgres psql "XXX" << EOF +CREATE LANGUAGE plpgsql; +EOF + +sudo -u postgres psql "XXX" < /usr/share/postgresql/8.3/contrib/debversion.sql +}}} diff --git a/input/index.mdwn b/input/index.mdwn index b760dea..9bcee35 100644 --- a/input/index.mdwn +++ b/input/index.mdwn @@ -34,6 +34,7 @@ VCS repositories for ud-ldap and all our other stuff can be found at * [[howto/iscsi]]: How to setup a new iscsi initiator * [[howto/export-iscsi]]: How to export new iscsi LUNs * [[howto/install-kvm]]: How to setup a new kvm domain without going through d-i etc. +* [[howto/postgres]]: Random postgres stuff ## misc -- 2.20.1