2025-06-04 - version 2.20

This is a maintenance release that fixes some issues reported by users since
last release and adds an new command line option -V, --verbose to the
pg_restorebinary command.

  - Change directory to writable one when sudo -u is used to avoid
    pg_restore to complain about "could not change directory" when
    the current directory is not writable by the running user. In
    this case pg_dumpbinary and pg_restorebinary will require an
    absolute path respectively for output and input directory.
    Thanks to Simon Beck for the report.
  - Do not import the tmpdir method when importing File::Spec.
  - Add -V, --verbose option to pg_restorebinary. Thanks to Simon Beck for
    the report.
  - Fix returned error code when no input directory or missing parameters.
    Thanks to Simon Beck for the report.

2025-04-08 - version 2.19

This is a maintenance release that fixes a major bug when dumping data
from tables with the dollar sign.

  - Set application_name to program name when connecting to PostgreSQL.
  - Fix missing data when dumping a table with dollar sign in its name
    or schema name.
  - Fix regression test when different PG versions are used.
  - Update copyright year.

2024-06-22 - version 2.18

This is a maintenance release that fixes bugs reported by users since
last release.

  - Add regression test for table needing to be quoted.
  - Fix typo in perl-DateTime install command. Thanks to Jerry Freelancer
    for the report.
  - Fix double copy statements if table name requires double quote. Thanks
    to Isabelle Vogt for the report.
  - Fix error when restoring a table with a GENERATED ALWAYS column.
    Thanks to Sobvlar for the report.

2024-05-17 - version 2.17

This release adds two new options:

  - Add option -C, --create to pg_restorebinary to create the database
    before restoring into it. Like with pg_restore you must provide a
    database to connect using the -d option.
  - Add --dump-create to print to stdout the create and alter database
    statements.

2024-04-06 - version 2.16

This release fixes data restoration for tables where schema or table names
contain the dollar sign ($).

2024-02-14 - version 2.15

This release adds a new option and fixes a bug reported by users since
last release.

  - Add -w, --where command line option to pg_dumpbinary to apply a filter
    to the data dumped. The filter will be used in a WHERE clause for data
    export, this clause will be applied to all tables dumped. Thanks to Mike
    Tefft for the feature request.
  - Fix error "DBD::Pg::db do failed: server closed the connection unexpectedly"
    when the attempt to dump the pre-data section fail.

2024-01-09 - version 2.14

This release adds two new options and fixes some bugs reported by users
since last release.

  - Add new option --with-child, when -t or -T option are used, include
    or exclude child and partition tables. pg_dump will be used instead
    with options --table-and-children or --exclude-table-and-children.
    Require PostgreSQL >= 16.
  - Add -V, --verbose option that lists tables included in the dump.
    Thanks to Mike Tefft for the feature request.
  - Add new command line option to pg_dumpbinary: -A, --attach SNAPSHOT
    to be able to attach pg_dumpbinary to an existing snapshot instead
    of creating a dedicated one. Thanks to Thomas Reiss for the feature
    request.
  - Fix case where sequences name have spaces. Thanks to Ki Woohyun for
    the report.
  - Fix regression tests original dump.

2023-10-04 - version 2.13

This release fix a restore issue with dropped columns.

 - Fix export of tables columns list to exclude those where attisdropped
   is true. Thanks to Mike Tefft for the report.

2023-07-25 - version 2.12

This release fix a privilege issue during dump.

  - Change default path to the snapshot_info file, it was .snapshot_info
    created in the current directory but this can lead to privilege issues.
    Moved to /tmp/snapshot_info by default.
  - Add -s, --snapshot-file option to be able to change the path to the
    snapshot information file used by multiprocess. Default: /tmp/snapshot_info

2023-05-23 - version 2.11

This release fix a major issue during dump restore.

  - Fix restoration of extensions tables from the dumps. Data from these tables
    was not restored since the use of pg_restore pre-data section to retrieve
    the list of tables from the dump. pg_dumpbinary now create a new file into
    the dump directory: "extensions-tables.lst". At restore time, command line
    filters on schemas and tables are also applied on this list if you need to
    exclude some of them.

  - Assume backward compatibility with old dumps that does not have the file
    "extensions-tables.lst" generated.


2023-03-30 - version 2.10

This release adds a new option to pg_dumpbinary

  -C, --compress-level 0-9   speed of the gzip compression using the specified
                             digit, between 1 and 9, default to 6. Setting it
                             to 0 disable the compression.

and fixes several issues reported since last release.

Full list of changes and acknowledgements:

  - Fix regression tests to exclude from the diff output DDL on public schema.
  - Quote schema and table names with pg_restore options -n/-N and -t/-T to
    avoid system command error with object names containing character like $.
    Thanks to Richard Barclay for the report.
  - Remove two debug traces introduced in last release.
  - Add -C / --compress-level pg_dumpbinary option to allow to choose the gzip
    compression level. Thanks to Derek Morr for the suggestion.
  - Fix duplicate double quoting of the schema+table when exporting data, now
    that the list of table is extracted using pg_restore they are already
    double quoted.
  - Fix truncate not applied when the table was empty at dump time. Thanks to
    Simon Beck for the report.
  - Fix exit code of pg_dumpbinary when a copy child process exit with error.
  - Add ON_ERROR_STOP=1 to stop the psql command on error in pg_dumpbinary.

2023-02-04 - version 2.9

This is a maintenance release to fix two problems in pg_restorebinary introduced
in last release.

  - pg_restorebinary was always reporting an error from system command when the
    dump does not contain a partitioned table.
  - Fix exit code of pg_restorebinary when a child dies and interrupt the restore
    process.

2023-01-30 - version 2.8

This release adds some new features to pg_restorebinary and fix some issues
reported since last release.

  - Force pg_restorebinary to stop on pg_restore or psql system command error,
    print the failing command and exit with code 1. Thanks to Mike Tefft for
    the feature request.
  - Add option -f, --outfile to generate a restore file usable with psql.
    The purpose of this option is to be able to debug pg_dumprestore by
    looking at the generated DDL and \copy commands.

Full list of changes:

  - Fix pg_dumpbinary failure in dumping partition less partitioned tables.
    Thanks to Mike Tefft for the report.
  - Add regression test on restoring dump with the --load-via-partition-root
    option.
  - Add regression test for partitioned table without partition.
  - Fix restore of data in a partitioned table when --load-via-partition-root
    was used with the pg_dumpbinary command. Thanks to Mike Tefft for the
    report.

2022-03-14 - version 2.7

This release adds two new options to pg_restorebinary

  -E, --exclude-ext EXTNAME    name of an extension to not restore, it can
                               be used multiple time.
  --schema-exists              add an IF NOT EXISTS clause to CREATE SCHEMA

they can be useful to fix extensions dependencies for example when the creation
order have changed. They can be created manually and be excluded from the
restoration, the extension's configuration tables data are still restored, this
just remove the extension creation statement. If a schema exists before the
restoration, the --schema-exists will prevent the command to fail at schema
creation by appending a IF NOT EXISTS clause.

2022-03-10 - version 2.6

This new release adds a new option --load-via-partition-root to pg_dumpbinary
to dump/restore data through the partitioned table only not per partition like
the default behavior. It makes the COPY statements target the root of the
partitioning hierarchy rather than the partition, this may be useful when
reloading data on a server where rows do not always fall into the same
partitions as they did on the original server. This is the equivalent to
the pg_dump option.

2021-09-01 - version 2.5

This new release adds support to data restoration in tables with altered
structure. pg_dumpbinary will now create a file meta-schema.table.txt that
stores the tables columns list at export time. pg_restore binary will read
this file if present or get le target columns list from the pre-data section
dumped. The target list will be appended to the COPY FROM command to avoid
error messages like "ERROR: row field count is 28, expected 29". This is
necessary for tables from upgraded extensions with more columns or if you
try to import data only into an existent table with more columns.

2021-06-22 - version 2.4

This new release adds a new option to pg_restorebinary --truncate
to be able to truncate the tables before restoring data. This can
be useful when pg_restorebinary is used to refresh data from some
tables.

2020-10-28 - version 2.3

This is a maintenance release to fix setting of sequences values after
restoring data, sequences values from extensions was not restored.

Other minor fixes:

  - Update copyright year.
  - Fix documentation. Thanks to Jean-Paul Argudo for the report.

2020-08-21 - version 2.2

This short release adds support of sequences registered as configuration
table dump in an extension.

2020-08-20 - version 2.1

This release fixes some issues reported by users since last release
and adds news improvements.

  - Export of extension's table from extconfig tables list.
  - Restore sequence values with data binary dump/restore.
  - Add support to PostgreSQL v12 and the -f option to pg_restore.

Full list of changes:
 
  - Add regression test for sequences dump/restore.
  - Add tables with automatic sequences in the test origin database.
  - Fix regression test when destination database is not the same PG
    version than the test file.
  - Add restore of sequence values with the data binary dump/restore.
  - Retrieve version of pg_restore command to be able to add the
    option "-f -" for stdout output that is required with PG >= v12.
  - Add support to condition for extension's tables.
  - Add information about Date::Time Perl module installation.
  - Add export of extension's table from extconfig tables list.
  - Fix unmodified new URL to project.

2019-12-08 - version 2.0

This release fixes some issues reported by users since last release
and adds news features and improvements.

  - Add -a | --data-only option to pg_restorebinary to restore data
    only, not schema.
    Fix partition data import that do not need to delay partitions
    attachment at post data section.
  - Prevent waiting 30 seconds that the snapshot connection be closed
    at end of the dump.
  - Add support to dump/restore partitions independently from the
    partitioned tables. In previous version dumping a partitioned
    table generate the following error:
    
        ERROR: cannot copy from partitioned table "..."
    
    pg_dumpbinary dumps partitions data independently and just skip
    the partitioned table. pg_restorebinary restore partitions without
    attaching them to the partitioned table then restore data directly
    into the partition then attach the partitions to the partitioned
    table.
  - On some dumps through a firewall the inactive connection that
    maintain the snapshot state is kill after a certain time. This
    fix forks the process to keep this connection active by issuing
    a 'SELECT 1;' each 30 seconds.
  - Add date to log information when dumping pre and post section.
  - Fix restoration of table with name that need to be double quoted.
  - Fall back to UTC timezone if cannot determine the local one.
    Thanks to Luca Ferrari for the patch.
  - Changed a print to printf to allow newline. Thanks to Luca Ferrari
    for the patch.
  - Change the usage of external `date` to DateTime. Thanks to Luca 
    Ferrari for the patch.
  - Copyright and Github project moved to LzLabs, license unchanged.

Backward compatibility with previous backup is preserved.

2019-08-30 - version 1.0

  First public release.


