Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-9602

Postgres timestamp null with default is "1970-01-01T00:00:00.000000Z"

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      2.7.3.Final and 3.3.1.Final

      What is the connector configuration?

       

      {
        "name": "pg-connector",
        "config": {
          "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
          "plugin.name": "pgoutput",
          "database.hostname": "postgres",
          "database.port": "5432",
          "database.user": "postgres",
          "database.password": "123456",
          "database.dbname" : "postgres",
          "database.server.name": "pg-dev",
          "table.include.list": "public.(.*)",
          "heartbeat.interval.ms": "5000",
          "slot.name": "dbname_debezium",
          "publication.name": "dbname_publication",
          "value.converter": "org.apache.kafka.connect.json.JsonConverter",
          "value.converter.schemas.enable": "false",
          "topic.prefix": "pg-dev",
          "max.request.size": "159977748",
          "buffer.memory": "259977748",
          "snapshot.mode": "no_data"
        }
      }

       

       

      What is the captured database version and mode of deployment?

      PostgreSQL 16.5 (Debian 16.5-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit on my local laptop

      What behavior do you expect?

       

      {
      "before": null,
      "after": {
      "id": 1,
      "created": null
      },  

      What behavior do you see?

      {
      "before": null,
      "after": {
      "id": 1,
      "created": "1970-01-01T00:00:00.000000Z"
      },

      Do you see the same behaviour using the latest released Debezium version?

      i have tried 3.3.1.Final - the behaviour was the same.

      Do you have the connector logs, ideally from start till finish?

      yes, attached

      How to reproduce the issue using our tutorial deployment?

      I have created next table

      create table public.debezium_bug_example (
      id serial primary key ,
      created timestamptz default current_timestamp
      );
      insert into public.debezium_bug_example (created)
      values (null);
      
      select * from public.debezium_bug_example;

      After last select i've found row (1, <null>)

      but in kafka i've got an incorrect message (look above)

              Unassigned Unassigned
              bomzheg Yuriy Chebyshev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: