Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create script does not contain policy comment #7414

Open
chreck opened this issue Apr 22, 2024 · 0 comments
Open

Create script does not contain policy comment #7414

chreck opened this issue Apr 22, 2024 · 0 comments
Assignees

Comments

@chreck
Copy link

chreck commented Apr 22, 2024

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:

  1. Open Query Tool
  2. 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';
  1. Refresh tables
  2. Right click on table table_comments_policies
  3. 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:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants