aboutsummaryrefslogtreecommitdiff
path: root/content/blog/miscellaneous/postgresql-read-only.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/blog/miscellaneous/postgresql-read-only.md')
-rw-r--r--content/blog/miscellaneous/postgresql-read-only.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/blog/miscellaneous/postgresql-read-only.md b/content/blog/miscellaneous/postgresql-read-only.md
new file mode 100644
index 0000000..c064e97
--- /dev/null
+++ b/content/blog/miscellaneous/postgresql-read-only.md
@@ -0,0 +1,17 @@
+---
+title: "Grant postgresql read only access"
+linkTitle: "Grant postgresql read only access"
+date: 2015-11-24
+description: >
+ Grant postgresql read only access
+---
+
+{{< highlight sh >}}
+GRANT CONNECT ON DATABASE "db" TO "user";
+\c db
+GRANT USAGE ON SCHEMA public TO "user";
+GRANT SELECT ON ALL TABLES IN SCHEMA public TO "user";
+ALTER DEFAULT PRIVILEGES IN SCHEMA public
+ GRANT SELECT ON TABLES TO "user";
+{{< /highlight >}}
+