pgadmin4
pgadmin4 copied to clipboard
Create script does not contain policy comment
Describe the bug
In the object explorer we select a table and by right click on that table we choose Scripts > CREATE Script. In the detailed view we see the query to create the table and all its details. I.e. also the comments on the columns and the table. But I missing the comments for the defined policies.
To Reproduce
Steps to reproduce the behavior:
- Open Query Tool
- Copy this SQLs and execute it
CREATE TABLE IF NOT EXISTS public.table_comments_policies
(
id bigint NOT NULL
)
CREATE POLICY plcy_table_comments_policies
ON public.table_comments_policies
AS PERMISSIVE
FOR ALL
TO authenticated
USING (true)
WITH CHECK (true);
COMMENT ON POLICY "plcy_table_comments_policies" ON "public"."table_comments_policies" IS 'All: auths';
- Refresh tables
- Right click on table table_comments_policies
- Choose Scripts > CREATE Script
Expected behavior
The expected behavior is that SQLs from the create scripts command contains the COMMENT ON POLICY
command, but it is not included.
-- Table: public.table_comments_policies
-- DROP TABLE IF EXISTS public.table_comments_policies;
CREATE TABLE IF NOT EXISTS public.table_comments_policies
(
id bigint NOT NULL
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.table_comments_policies
OWNER to postgres;
GRANT ALL ON TABLE public.table_comments_policies TO anon;
GRANT ALL ON TABLE public.table_comments_policies TO authenticated;
GRANT ALL ON TABLE public.table_comments_policies TO postgres;
GRANT ALL ON TABLE public.table_comments_policies TO service_role;
-- POLICY: plcy_table_comments_policies
-- DROP POLICY IF EXISTS plcy_table_comments_policies ON public.table_comments_policies;
CREATE POLICY plcy_table_comments_policies
ON public.table_comments_policies
AS PERMISSIVE
FOR ALL
TO authenticated
USING (true)
WITH CHECK (true);
Error message
No error message.
Screenshots
No screenshots attached.
Desktop:
- OS: macOS 14.4.1
- Version: 8.5
- Mode: Desktop
- Browser: chrome
- Package type: pgadmin4-8.5-arm64.dmg
Additional context
- Considering to add the comment also after choosing CREATE Script by right clicking on the policy item in Object Explorer itself
- Considering to add the comment also in the Properties view by right clicking on the policy item in Object Explorer itself