From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Erik Rijkers <er(at)xs4all(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, DUVAL REMI <REMI(dot)DUVAL(at)cheops(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: proposal: schema variables |
Date: | 2024-12-11 20:51:43 |
Message-ID: | CAFj8pRBVQVGMSGOhEcUPVOO_0+v1q0TcH_H+fExYG=EFvWA4sg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-performance |
Hi
út 10. 12. 2024 v 4:32 odesílatel jian he <jian(dot)universality(at)gmail(dot)com>
napsal:
> hi.
>
> GRANT|REVOKE ALL VARIABLES IN SCHEMA schema_name [, ...] }
> seems to work.
> might be better to add tests.
>
done
>
> also src/bin/psql/tab-complete.in.c
> COMPLETE_WITH_SCHEMA_QUERY_PLUS(Query_for_list_of_grantables,
> we can also add "ALL VARIABLES IN SCHEMA "
>
done
>
> also need change this <para> in grant.sgml:
> <para>
> There is also an option to grant privileges on all objects of the same
> type within one or more schemas. This functionality is currently
> supported
> only for tables, sequences, functions, and procedures. <literal>ALL
> TABLES</literal> also affects views and foreign tables, just like the
> specific-object <command>GRANT</command> command. <literal>ALL
> FUNCTIONS</literal> also affects aggregate and window functions, but not
> procedures, again just like the specific-object <command>GRANT</command>
> command. Use <literal>ALL ROUTINES</literal> to include procedures.
> </para>
>
done
>
> revoke.sgml, we should use <replaceable
> class="parameter">role_specification</replaceable>?
> so it will become like:
>
> REVOKE [ GRANT OPTION FOR ]
> { { SELECT | UPDATE } [, ...] | ALL [ PRIVILEGES ] }
> ON { VARIABLE variable_name [, ...]
> | ALL VARIABLES IN SCHEMA schema_name [, ...] }
> FROM role_specification [, ...]
>
done
>
> maybe also add
> [ GRANTED BY role_specification ]
> but I didn't test "REVOKE [ GRANTED BY role_specification ]".
>
It i working, so I enhanced doc and regress tests
>
> Speaking of acl tests,
> similar to has_table_privilege I am afraid we need to have a function
> like has_variable_privilege for acl tests.
> has_table_privilege has 6 function signatures. so there will be more code.
>
ok, I wrote these functions
> ------------------------------------------------------
> doc/src/sgml/ref/create_variable.sgml
> <synopsis> section:
> CREATE VARIABLE [ IF NOT EXISTS ] name [ AS ] data_type ] [ COLLATE
> collation ]
>
> redundant right square bracket after "data_type".
>
fixed
Regards
Pavel
From | Date | Subject | |
---|---|---|---|
Next Message | David Rowley | 2024-12-11 20:55:41 | Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE |
Previous Message | Tom Lane | 2024-12-11 20:48:57 | Re: Pass ParseState as down to utility functions. |
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2024-12-14 15:40:42 | Re: proposal: schema variables |
Previous Message | Lars Aksel Opsahl | 2024-12-11 13:29:23 | Re: PostgreSQL and a Catch-22 Issue related to dead rows |