provider-sql icon indicating copy to clipboard operation
provider-sql copied to clipboard

How to do "GRANT ALL ON SCHEMA public TO demo;" in postgres grant?

Open sokoow opened this issue 1 year ago • 10 comments

What problem are you facing?

I'm trying for postgres Grant to invoke:

GRANT ALL ON SCHEMA public TO demo;

but can't find anything that would allow me to do it. Is there any way?

How could Crossplane help solve your problem?

I'd expect for grant object to have such an option.

sokoow avatar Aug 08 '23 07:08 sokoow

Hi, I was checking quite a similar feature but seems like the grant privileges at the table/schema level is not supported by the provider.

I'm considering trying to contribute to add this feature. But I'm not really familiar with Go. I was checking this: https://github.com/crossplane-contrib/provider-sql/blob/35ae0ec0b00b2b3436ac16c67b4e8aeea0c61532/pkg/controller/postgresql/grant/reconciler.go#L253

Bastichou avatar Aug 10 '23 13:08 Bastichou

Hi @sokoow and @Bastichou I am currently facing issues on the same spectrum as you guys are, having grant privileges at table/schema level is needed to solve the major scenarios i am running into with the provider

Did you guys have any luck working around these limitations?

YuriFarias741 avatar Aug 31 '23 15:08 YuriFarias741

Hi,

Unfortunately not yet.. I just had time to have a look to the base code. Like I said this would be my first contribution so I don't have any ETA.

Bastichou avatar Sep 12 '23 13:09 Bastichou

Same here. GRANT privilege ON table/schema is an essential and highly needed feature. Without this, there is no way to manage user permissions declaratively :(

JaniszM avatar Mar 27 '24 11:03 JaniszM

Hi,

I agree with the previous comments especially as the Public schema is no longer really public since the version 15 of PostgreSQL (cf https://www.cybertec-postgresql.com/en/error-permission-denied-schema-public/).

This feature is important for one of my projects because we will not stay on PostgreSQL version 14 forever...

FelixLusseau avatar May 06 '24 14:05 FelixLusseau

Hi guys,

I have a work in progress to fix this issue. Too early yet to have a PR but i'll keep you posted.

Goal is to add the management of Schema resource and then extend the Grant resource to allow schema reference.

https://github.com/Bastichou/provider-sql/tree/feat/support-pgsql-schema-resource

Bastichou avatar May 06 '24 15:05 Bastichou