summaryrefslogtreecommitdiff
path: root/db/rest/user/api_user_update.sql
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--db/rest/user/api_user_update.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/rest/user/api_user_update.sql b/db/rest/user/api_user_update.sql
new file mode 100644
index 0000000..c6e7f4f
--- /dev/null
+++ b/db/rest/user/api_user_update.sql
@@ -0,0 +1,21 @@
+CREATE FUNCTION _api.user_update()
+RETURNS TRIGGER
+LANGUAGE plpgsql VOLATILE
+AS $BODY$
+DECLARE
+ _length INTEGER;
+BEGIN
+ RETURN NEW;
+END
+$BODY$;
+
+GRANT EXECUTE ON FUNCTION _api.user_update()
+ TO rest_user;
+GRANT DELETE ON TABLE api.user
+ TO rest_user;
+
+CREATE TRIGGER api_user_update_trgr
+ INSTEAD OF UPDATE
+ ON api.user
+ FOR EACH ROW
+ EXECUTE PROCEDURE _api.user_update();