Skip to main content

pg_restore_invocation

Function pg_restore_invocation 

Source
pub fn pg_restore_invocation(
    conn: &PgConnection,
    data_only: bool,
) -> SqlInvocation
Expand description

Build the pg_restore invocation for an IMPORT (reads the custom-format dump from stdin). --data-only restores only the data into the target’s existing migrated schema; --exit-on-error aborts loudly on the first failed object. Unlike psql/ pg_dump, pg_restore does NOT infer the target from PGDATABASE — without -d (restore into a database) or -f (emit a script) it refuses with “one of -d/–dbname and -f/–file must be specified”; so the target database is named with -d (the host/ port/user/password still come from the env, and the db name is not a credential).