Skip to content

dump-to-postgresql

Help command

> csm-data store dump-to-postgresql --help

 Usage: csm-data store dump-to-postgresql [OPTIONS]                                                                                                                                                                

 Running this command will dump your store to a given postgresql database                                                                                                                                          
 Tables names from the store will be prepended with table-prefix in target database                                                                                                                                

 The postgresql user must have USAGE granted on the schema for this script to work due to the use of the command COPY FROM STDIN                                                                                   



 You can simply give him that grant by running the command: GRANT USAGE ON SCHEMA  TO                                                                                                                              

╭─ OPTIONS ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --store-folder                            PATH     The folder containing the store files                                                                                                                     │
│                                                       ENV: CSM_PARAMETERS_ABSOLUTE_PATH                                                                                                                         │
│                                                       [required]                                                                                                                                                │
│    --table-prefix                            PREFIX   Prefix to add to the table name                                                                                                                           │
│ *  --postgres-host                           TEXT     PostgreSQL host URI                                                                                                                                       │
│                                                       ENV: POSTGRES_HOST_URI                                                                                                                                    │
│                                                       [required]                                                                                                                                                │
│    --postgres-port                           INTEGER  PostgreSQL database port                                                                                                                                  │
│                                                       ENV: POSTGRES_HOST_PORT                                                                                                                                   │
│ *  --postgres-db                             TEXT     PostgreSQL database name                                                                                                                                  │
│                                                       ENV: POSTGRES_DB_NAME                                                                                                                                     │
│                                                       [required]                                                                                                                                                │
│ *  --postgres-schema                         TEXT     PostgreSQL schema name                                                                                                                                    │
│                                                       ENV: POSTGRES_DB_SCHEMA                                                                                                                                   │
│                                                       [required]                                                                                                                                                │
│ *  --postgres-user                           TEXT     PostgreSQL connection user name                                                                                                                           │
│                                                       ENV: POSTGRES_USER_NAME                                                                                                                                   │
│                                                       [required]                                                                                                                                                │
│ *  --postgres-password                       TEXT     PostgreSQL connection password                                                                                                                            │
│                                                       ENV: POSTGRES_USER_PASSWORD                                                                                                                               │
│                                                       [required]                                                                                                                                                │
│    --replace/--append                                 Append data on existing tables                                                                                                                            │
│                                                       DEFAULT: replace                                                                                                                                          │
│    --encode-password/--no-encode-password             Force encoding of password to percent encoding                                                                                                            │
│                                                       ENV: CSM_PSQL_FORCE_PASSWORD_ENCODING                                                                                                                     │
│                                                       DEFAULT: encode-password                                                                                                                                  │
│    --help                                             Show this message and exit.                                                                                                                               │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯