跳至正文
Wener Notes

pgloader

约 1 分钟阅读
    • MySQL, SQLite, MS SQL Server, CSV, HTTP, Archive, PostgreSQL to PostgreSQL, Citus
    • MySQL to PostgreSQL Continuous Migration
    • COPY streaming
  • postgresql://[user[:password]@][netloc][:port][/dbname][?option=value&...]
  • sqlite
    • FROM - url, file, .zip
    • WITH
      • include drop
      • include no drop
      • truncate
      • no truncate
      • disable triggers
      • create [no] indexes/tables
      • drop indexes
      • reset [no] sequences
      • schema only
      • data only
      • encoding = UTF-8
    • including only table names like 'invoice%'
    • excluding table names like 'appointments'
bash
docker run --rm -it --name pgloader dimitri/pgloader:latest pgloader --version

pgloader --context ./sqlite.ini ./sqlite.load
sqlite.load
load database
  from '{{DBPATH}}'
  into postgresql:///pgloader;
sqlite.ini
[pgloader]
DBPATH = sqlite/sqlite.db
text
load database
   from mysql://user@host/dbname
   into pgsql://user@host/dbname
  with create no schema
  alter schema 'dbname' rename to 'public';
text
load database
     from sqlite:///data/tags.db
     into postgresql:///tags

 with include drop, create tables, create indexes, reset sequences

  set work_mem to '16MB', maintenance_work_mem to '512 MB';

FAQ

10 fell through ECASE expression. Wanted one of (0 2 3 4 5 6 7 8).

不支持新版 14+ 的默认 auth 逻辑

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub2 条
最近更新commit 56715c7编辑