pg_shard icon indicating copy to clipboard operation
pg_shard copied to clipboard

Cannot read data in partition sets

Open keithf4 opened this issue 10 years ago • 3 comments

Someone posted an issue in the repo for pg_partman about not being able to read data from the parent table when used in combination with pg_shard. Haven't been able to reproduce this at this time, but wondered if anyone here might be able to help them or if there are any known issues when using table inheritance with sharding

https://github.com/keithf4/pg_partman/issues/70

keithf4 avatar Oct 17 '15 13:10 keithf4

I'm running into the exact same problem. Queries directly to the sharded tables on workers return results from their partition tables as expected; however, queries to the master node return 0 rows.

A-F1V3 avatar Mar 11 '16 17:03 A-F1V3

So the issue here is that queries from the master node to the shards include the ONLY key word. For example:
SELECT * FROM ONLY shard_table_1234 WHERE partition_key = 1;

ONLY explicitly tells postgres to not search descendant tables.

Is there a way to disable this, or is there potentially a work around?

A-F1V3 avatar Mar 11 '16 19:03 A-F1V3

Please note that pg_shard is deprecated. Its more powerful replacement is Citus; and all logic within pg_shard is natively integrated to Citus: https://github.com/citusdata/citus

I think the following issue may be related: https://github.com/citusdata/citus/issues/475

ozgune avatar May 14 '16 22:05 ozgune