Fixes error code 42803 when trying to query a view with a column named count.

This commit is contained in:
Diogo Biazus
2015-08-01 00:15:17 -04:00
parent e724c2df00
commit 449cacdacf
4 changed files with 19 additions and 3 deletions
+10
View File
@@ -182,6 +182,11 @@ CREATE VIEW "1".insertable_view_with_join AS
ALTER TABLE "1".insertable_view_with_join OWNER TO postgrest_test;
CREATE VIEW "1".has_count_column AS
SELECT 1 AS count;
ALTER TABLE "1".insertable_view_with_join OWNER TO postgrest_test;
CREATE TABLE items (
id bigint NOT NULL
@@ -563,6 +568,11 @@ REVOKE ALL ON TABLE insertable_view_with_join FROM postgrest_test;
GRANT ALL ON TABLE insertable_view_with_join TO postgrest_test;
GRANT ALL ON TABLE insertable_view_with_join TO postgrest_anonymous;
REVOKE ALL ON TABLE has_count_column FROM PUBLIC;
REVOKE ALL ON TABLE has_count_column FROM postgrest_test;
GRANT ALL ON TABLE has_count_column TO postgrest_test;
GRANT ALL ON TABLE has_count_column TO postgrest_anonymous;
REVOKE ALL ON FUNCTION public.always_true("1".items) FROM PUBLIC;
REVOKE ALL ON FUNCTION public.always_true("1".items) FROM postgrest_test;
GRANT ALL ON FUNCTION public.always_true("1".items) TO postgrest_test;