Cannot read data in partition sets
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
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.
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?
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