On Fri, Mar 17, 2023 at 03:43:58PM +0000, gkokolatos@pm.me wrote:
> From a174cdff4ec8aad59f5bcc7e8d52218a14fe56fc Mon Sep 17 00:00:00 2001
> From: Georgios Kokolatos <gkokolatos@pm.me>
> Date: Fri, 17 Mar 2023 14:45:58 +0000
> Subject: [PATCH v3 1/3] Improve type handling in pg_dump's compress file API
> -int
> +bool
> EndCompressFileHandle(CompressFileHandle *CFH)
> {
> - int ret = 0;
> + bool ret = 0;
Should say "= false" ?
> /*
> * Write 'size' bytes of data into the file from 'ptr'.
> + *
> + * Returns true on success and false on error.
> + */
> + bool (*write_func) (const void *ptr, size_t size,
> - * Get a pointer to a string that describes an error that occurred during a
> - * compress file handle operation.
> + * Get a pointer to a string that describes an error that occurred during
> + * a compress file handle operation.
> */
> const char *(*get_error_func) (CompressFileHandle *CFH);
This should mention that the error accessible in error_func() applies (only) to
write_func() ?
As long as this touches pg_backup_directory.c you could update the
header comment to refer to "compressed extensions", not just .gz.
I noticed that EndCompressorLZ4() tests "if (LZ4cs)", but that should
always be true.
I was able to convert the zstd patch to this new API with no issue.
--
Justin