citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.46k stars 662 forks source link

run_command_on_colocated_placements doesn't work on Citus Cloud #1713

Closed sumedhpathak closed 5 years ago

sumedhpathak commented 6 years ago

Gives this error:

ERROR:  42501: permission denied for schema citus
LINE 8:  table1_placements citus.colocation_placement_type[];

The issues is that colocation_placement_type appears to be in the citus schema, but that has access permissions.

Chatting with Marco, we were thinking of a few different options, but then realized we could possibly rewrite the using function to use pg_dist_colocation (or just compare colocation-id's) https://github.com/citusdata/citus/blob/54b1ebb14e16b1a700221f3414768bcc1161a79f/src/backend/distributed/citus--6.1-13--6.1-14.sql#L27. It appears this function might predate formal colocation support.

fdr commented 5 years ago

It probably doesn't work without superuser in general, no?

colton-citus commented 5 years ago

This is still an issue on Hyperscale and on Citus Cloud. Minimum reproduction steps on any cluster:

create table colocated_table_1(dist_col int);
create table colocated_table_2(dist_col int);
select create_distributed_table('colocated_table_1','dist_col');
select create_distributed_table('colocated_table_2','dist_col');

SELECT run_command_on_colocated_placements('colocated_table_1','colocated_table_2',$cmd$SELECT 1;$cmd$);
fdr commented 5 years ago

Another customer has encountered this issue.