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

Avoid copy-pasting ruleutils files #52

Closed jasonmp85 closed 9 years ago

jasonmp85 commented 9 years ago

Because ruleutils.c's get_shard_query_def does not have external linkage, pg_shard copy-pastes ruleutils.c from the appropriate PostgreSQL release—with minimal modifications—to enable deparsing a given query back into one with shard identifiers.

These modifications are not likely to be accepted upstream as-is—they reference a shardId field we've added to deparse_context—but PostgreSQL may be open to exposing get_shard_query_def itself for external use. We'd need to:

jasonmp85 commented 9 years ago

I wrote a proof-of-concept for this idea here and wrote the mailing list here. No response yet, but the research and testing phases are done. Closing.