Sharding
COPY FROM
The COPY
command allows for efficient bulk copying of data into a sharded table. The data will be distributed across shards according to your sharding setup. For more information on the PostgreSQL COPY
command, see the PostgreSQL documentation.
You should be careful with this feature. If you don’t use two-phase commit. There is no concept of snapshot isolation across shards in SPQR. That means:
- A SELECT that runs on multiple shards at the same time may see results from some shards, but not from others.
- If an error occurs on a shard when you do a COPY, the transaction is rolled back only on that shard.
Some examples:
Was this page helpful?