IMPORT PGDUMP - Parse Syntax error near 'TOC'

We’re attempting to migrate a large Postgresql database dump over to CDB.

Dump from PGSQL:

pg_dump -v -U postgres -W -F t ourdatabase> /var/lib/postgresql/data/ExampleDump.tar

CDB Import:

IMPORT PGDUMP ‘https://s3.example.com/example/ExampleDump.tar’ WITH ignore_unsupported_statements, max_row_size = ‘2GB’

This results in the error:

ERROR: postgres parse error: at or near “toc”: syntax error
SQLSTATE: 42601
DETAIL: source SQL:
toc.dat
^
HINT: To ignore unsupported statements and log them for review post IMPORT, see the options listed in the docs: IMPORT | CockroachDB Docs

Any idea on how we can better diagnose this syntax issue on the import? If we can figure out the syntax of the query/parse we can get a better idea on how to resolve this.

Hi Brian!

Importing a tar-format Postgresql database dump isn’t currently supported. CRDB’s IMPORT PGDUMP statement expects a script dump.

Migrate from Postgres | CockroachDB Docs contains step-by-step instructions.

Hello,

I appreciate you pointing that out. We’ve been able to begin the process of importing the dump file, but we’re having issues related to RAM usage.

When we move to import this on the production server, that container has 60GB of RAM allocated. The SQL file itself is only 45GB in size. The container ends up running out of memory or using too much, causing our other services to go down.

Is there any ideas on how we could better sandbox this import or limit it’s resource allocation?