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

Provide ability to run "ALTER SQL SECURITY DEFINER / INVOKER" without specifying further part of proc/func/package #7744

Closed
pavel-zotov opened this issue Sep 11, 2023 · 6 comments · Fixed by #7807

Comments

@pavel-zotov
Copy link

Currently we can run:

alter trigger sql security <invoker | definer>

-- and not specify body of affected trigger.
But it is not so for other kind of PSQL units (SP, functions and package headers).
It will be useful if we have such ability also, i.e. without need to put into ALTER statement the further part of unit being changed (input/output parameters for SP/func; inner functions and procedures for packages).

@mrotteveel
Copy link
Member

That doesn't make sense. Those things are all tightly interrelated. Everything after AS is the body of the PSQL, so you cannot modify individual parts (at least, not without creating a hard to understand syntax), and I can't think of cases where you'd modify the input/output parameters of a PSQL module without touching the body code.

@aafemt
Copy link
Contributor

aafemt commented Sep 11, 2023

But this ticket is about changing of attributes of the object, not the object itself.

@dyemanov
Copy link
Member

#7427 is about nearly the same.

@pavel-zotov
Copy link
Author

As aafemt noted above, SQL SEC is attribute, not the body.
Triggers already can be altered in such way (without touching body). Why not for other kind of units ?

PS.
I've encountered inability to change SQL SEC attribute during implementation of test that must generate lot of SQL code that will verify almost all combinations of grants / SQL security values for 'top-level' units and all what they call or refer to (other PSQL units, tables, view).
Yes, i have the query that can extract header + params + rest body of any SP of function from RDB$, but it is extremely cumbersome. I can't make test with size of dozen Mb and then marvel at the speed of it :-)

@mrotteveel
Copy link
Member

Sorry, I read it wrong, I thought that just like ALTER SQL SECURITY, you wanted to modify other individual parts.

@pavel-zotov
Copy link
Author

PS.
It is also desirable to have ability to run:

alter {procedure | function | package} <unit_name> DROP sql security;

(i.e. not only to change it to some defined value, but make it null)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants