fix: Escape the escape chars so that auth_rls_initplan rule works properly (#23176)

Escape the escape chars so that auth_rls_initplan rule works properly.
This commit is contained in:
Ivan Vasilov authored and GitHub committed 2024-04-23 16:42:58 -02:30
1 parent e1b6db4b43
commit eadf3d5353
1 file changed
+4 -4
+4 -4
View File
@@ -221,16 +221,16 @@ where
and (
(
-- Example: auth.uid()
qual ~ '(auth)\.(uid|jwt|role|email)\(\)'
qual ~ '(auth)\\.(uid|jwt|role|email)\\(\\)'
-- Example: select auth.uid()
and lower(qual) !~ 'select\s+(auth)\.(uid|jwt|role|email)\(\)'
and lower(qual) !~ 'select\\s+(auth)\\.(uid|jwt|role|email)\\(\\)'
)
or
(
-- Example: auth.uid()
with_check ~ '(auth)\.(uid|jwt|role|email)\(\)'
with_check ~ '(auth)\\.(uid|jwt|role|email)\\(\\)'
-- Example: select auth.uid()
and lower(with_check) !~ 'select\s+(auth)\.(uid|jwt|role|email)\(\)'
and lower(with_check) !~ 'select\\s+(auth)\\.(uid|jwt|role|email)\\(\\)'
)
))
union all