-
Notifications
You must be signed in to change notification settings - Fork 156
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
Oracle error on a foreign table I have no privilege on #534
Comments
oracle_fdw runs queries against the foreign table when it plans the statement, which obviously happens before permissions on the table are checked. |
Not just a general question. I thought permissions were checked before planning since it sounds useless to plan something you won't have the right to execute and you have to check permission anyway but planning is light and most executions have the necessary privileges in a normal database...no matter. |
Still, I see your point. I debugged a little, and the permission error is thrown from the query executor after the query is planned. The root of this oddity is certainly that I connect to Oracle in the query planning phase, perhaps PostgreSQL does not anticipate that. |
Thanks. It's not critical at all and in fact my unprivileged user does have the right to query Oracle via its valid user mapping and to create foreign tables. Hence the situation I describe does not have any real-world logic : it's something I still have to deal with for legacy reasons in my ad-hoc Oracle=>PostgreSQL migration tool but my security model does not work like that anymore in the main programs. |
I have investigated some more, and postgres_fdw does the same thing when you turn on Anyway, thanks for the heads up. It is certainly good to be aware of this. |
Thanks. I sent a mail to the hackers list as you suggested.
Best regards,
Phil
…________________________________
De : Laurenz Albe ***@***.***>
Envoyé : samedi 4 juin 2022 21:42
À : laurenz/oracle_fdw ***@***.***>
Cc : philflorent ***@***.***>; Author ***@***.***>
Objet : Re: [laurenz/oracle_fdw] Oracle error on a foreign table I have no privilege on (Issue #534)
Closed #534<#534> as completed.
—
Reply to this email directly, view it on GitHub<#534 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOP2WEEF2I7VNSYFIJWP45TVNOWTJANCNFSM5XVDORMQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This was not documented anywhere, which can confuse users, as seen in issue #534. It is particularly confusing that the Oracle table is accessed even before permissions on the foreign table are checked, which can result in a surprising Oracle error. Report by Phil Florent.
Hi,
I noticed a behaviour I didn't expect. Not really a bug but I obtained an Oracle error instead of a PostgreSQL error with a foreign table I had no privilege on.
I thought I would obtain ERREUR: droit refusé pour la table distante user_col_comments (=> no privilege on foreign table) with my first select count(1) even if the Oracle DDL was wrong.
Best regards,
Phil
The text was updated successfully, but these errors were encountered: