diff --git a/airbyte-integrations/connectors/destination-postgres/metadata.yaml b/airbyte-integrations/connectors/destination-postgres/metadata.yaml index 457a8bde3106..6491a2fe2e15 100644 --- a/airbyte-integrations/connectors/destination-postgres/metadata.yaml +++ b/airbyte-integrations/connectors/destination-postgres/metadata.yaml @@ -6,7 +6,7 @@ data: connectorSubtype: database connectorType: destination definitionId: 25c5221d-dce2-4163-ade9-739ef790f503 - dockerImageTag: 3.0.15 + dockerImageTag: 3.0.16 dockerRepository: airbyte/destination-postgres documentationUrl: https://docs.airbyte.com/integrations/destinations/postgres githubIssueLabel: destination-postgres diff --git a/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresInsertBuffer.kt b/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresInsertBuffer.kt index 83be65a61c05..95f8fcc82d28 100644 --- a/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresInsertBuffer.kt +++ b/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresInsertBuffer.kt @@ -62,7 +62,7 @@ class PostgresInsertBuffer( "Finished insert of $recordCount row(s) into ${tableName.namespace}.${tableName.name}" } } catch (e: Exception) { - logger.error(e) { "Unable to flush accumulated data." } + throw e } finally { filePath.deleteIfExists() csvPrinter?.close() diff --git a/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresRecordFormatter.kt b/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresRecordFormatter.kt index 830e18b7d62c..41e48bd0891a 100644 --- a/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresRecordFormatter.kt +++ b/airbyte-integrations/connectors/destination-postgres/src/main/kotlin/io/airbyte/integrations/destination/postgres/write/load/PostgresRecordFormatter.kt @@ -46,7 +46,8 @@ class PostgresRawRecordFormatter( // Do not output null values in the JSON raw output val filteredRecord = record.filter { (k, v) -> v !is NullValue && !RAW_META_COLUMNS.contains(k) } - val jsonData = Jsons.writeValueAsString(filteredRecord) + // Sanitize null bytes from JSON data — PostgreSQL TEXT columns do not support \u0000 + val jsonData = Jsons.writeValueAsString(filteredRecord).replace("\u0000", "") // Iterate through columns in the exact order they appear in the table columns.forEach { column -> diff --git a/docs/integrations/destinations/postgres.md b/docs/integrations/destinations/postgres.md index aa72d5b05026..85255c1f9b58 100644 --- a/docs/integrations/destinations/postgres.md +++ b/docs/integrations/destinations/postgres.md @@ -299,6 +299,7 @@ This destination supports [namespaces](https://docs.airbyte.com/platform/using-a | Version | Date | Pull Request | Subject | |:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 3.0.16 | 2026-03-31 | [75902](https://github.com/airbytehq/airbyte/pull/75902) | Fix silent error swallowing in COPY flush and sanitize null bytes in raw JSON data | | 3.0.15 | 2026-08-07 | [83235](https://github.com/airbytehq/airbyte/pull/83235) | Fail sync on transient DB errors. | | 3.0.14 | 2026-07-30 | [82273](https://github.com/airbytehq/airbyte/pull/82273) | Remove column DROP logic during schema evolution; upgrade CDK to 1.0.20 | | 3.0.13 | 2026-04-17 | [76409](https://github.com/airbytehq/airbyte/pull/76409) | Upgrade CDK to 1.0.9. |