Skip to content

Command line parameters

Oleg Gurov edited this page Jul 19, 2020 · 12 revisions

About usage modes read here.

In all deployment modes two parameters are mandatory: --packet-name and --db-name.

Ways to list target databases:

--db-name=my_db_01	# deployment on the specified database only
--db-name=my_db_01,my_db_02	# deployment on the listed databases
--db-name=my_db_0*	# deployment on databases matching mask
--db-name=ALL		# deployment will be carried out on all databases specified in the [databases] section of db_converter.conf file
--db-name=ALL,exclude:my_db_01,my_db_02		# deployment on all databases except those listed after ",exclude:"
--db-name=ALL,exclude:my_db_0*			# deployment on all databases except those matching the mask "my_db_0*"
--db-name=ALL,exclude:my_db_0*,my_db_10		# deployment on all databases except those matching the mask "my_db_0*" and except "my_db_10"

By default, conversion is performed in parallel (asynchronous) mode on all specified databases. In some cases, sequential execution in the specified order is required. To do this use the --seq key.

Deployment options:

  • --seq - sequential execution in order listed in db_converter.conf
  • --force - ignore the difference between packet hashes. If the first execution of packet was completed with an error not related to the connection and this packet was modified during the next launch, then execution requires confirmation without --force option
  • --skip-step-cancel - skip whole step on first error like Deadlock, QueryCanceledError`
  • --skip-action-cancel - skip action errors like Deadlock, QueryCanceledError`

Additional options that can be used with --db-name and --packet-name (one of the following):

  • --status - get status of the packet for specified base (possible statuses: done, started, exception, new)
  • --wipe - delete information about --packet-name from action tracker (dbc_* tables)
  • --stop - execute pg_terminate_backend for all db_converter's connections with specific packet name
  • --list - list all databases according --db-name mask
  • --unlock - unlock the specified packet (delete row from dbc_locks table)

Extended options:

  • --template - copy *.sql files from packets/templates/template to packets/packet-name
  • --version - show version of db_converter

The types of errors, which is affected by parameters --skip-*-errors:

Exception name Code Description
QueryCanceledError 57014 Class 57 - Operator Intervention
AdminShutdownError 57P01 Class 57
CrashShutdownError 57P02 Class 57
ServerNotReadyError 57P03 Class 57
DeadlockError 40P01 Class 40 - Transaction Rollback

If --skip-*-errors are not specified, then a re-transaction will be performed for the above exceptions, after conn_exception_sleep_interval seconds. All other types of exceptions will cause the packet deployment to complete, with the stack trace written to the dbc_steps.exception_descr table.

Clone this wiki locally