citusdata / pg_shard

ATTENTION: pg_shard is superseded by Citus, its more powerful replacement
https://github.com/citusdata/citus
GNU Lesser General Public License v3.0
1.06k stars 63 forks source link

Cannot read data in partition sets #151

Open keithf4 opened 8 years ago

keithf4 commented 8 years ago

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

A-F1V3 commented 8 years ago

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 commented 8 years ago

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?

ozgune commented 8 years ago

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