-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Imagine the following case using the #>> operator (which returns a text[] array):
CREATE TABLE repro (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
data jsonb DEFAULT '{}'
);
CREATE POLICY p ON repro USING ((data #>> '{nested,key}'::text[]) = 'x');I'd expect pgschema dump to return something like:
CREATE POLICY p ON repro TO PUBLIC USING ((data #>> '{nested,key}'::text[]) = 'x');Instead I get the following, which is invalid:
CREATE POLICY p ON repro TO PUBLIC USING ((data #>> '{nested,key}'[]) = 'x');Not that the type name (::text) is being stripped from the explicit array literal casts and only the array part is left ([]), which results in an invalid syntax. I have managed to reproduce it with JSONB path operators (#>>, #>, ...) but I suspect this may go beyond that.
Reactions are currently unavailable