Migrating a PostgreSQL Database to Citus ======================================== This command instructs pgloader to load data from a database connection. Automatic discovery of the schema is supported, including build of the indexes, primary and foreign keys constraints. A default set of casting rules are provided and might be overloaded and appended to by the command. Automatic distribution column backfilling is supported, either from commands that specify what is the distribution column in every table, or only in the main table, then relying on foreign key constraints to discover the other distribution keys. Here's a short example of migrating a database from a PostgreSQL server to another: :: load database from pgsql:///hackathon into pgsql://localhost:9700/dim with include drop, reset no sequences cast column impressions.seen_at to "timestamp with time zone" distribute companies using id -- distribute campaigns using company_id -- distribute ads using company_id from campaigns -- distribute clicks using company_id from ads, campaigns -- distribute impressions using company_id from ads, campaigns ; Everything works exactly the same way as when doing a PostgreSQL to PostgreSQL migration, with the added fonctionality of this new `distribute` command. Distribute Command ^^^^^^^^^^^^^^^^^^ The distribute command syntax is as following:: distribute