debezium / debezium/dbz

Postgres timestamp null with default is "1970-01-01T00:00:00.000000Z" [DBZ-9602]

Open
#96 0 comments 0 reactions 0 assignees View on GitHub
component/postgresql-connector migrated-from-jira type/bug
Dominant language
HTML
Stars
6
Forks
8
Avg merge
2d 19h
Merged PRs (30d)
1

Description

Migrated from [DBZ-9602](https://issues.redhat.com/browse/DBZ-9602)

h1. Bug report

For bug reports, provide this information, please:
h2. What Debezium connector do you use and what version?

2.7.3.Final and 3.3.1.Final
h2. What is the connector configuration?

 
{code:java}
{
"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"
}
}{code}
 

 
h2. 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
h2. What behavior do you expect?
 
{code:java}
{
"before": null,
"after": {
"id": 1,
"created": null
},  {code}
h2. What behavior do you see?
{code:java}
{
"before": null,
"after": {
"id": 1,
"created": "1970-01-01T00:00:00.000000Z"
},{code}
h2. Do you see the same behaviour using the latest released Debezium version?

i have tried 3.3.1.Final - the behaviour was the same.
h2. Do you have the connector logs, ideally from start till finish?

yes, attached
h2. How to reproduce the issue using our [tutorial|https://github.com/debezium/debezium-examples/tree/main/tutorial] deployment?

I have created next table
{code:java}
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;{code}
After last select i've found row (1, )

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

Contributor guide

Open the contributing guide

Research direction

Start with the Debezium tutorial deployment and the PostgreSQL 16.5 setup described in the report. Reproduce the table and insert statement, then compare the database row with the Kafka message. Done means a NULL timestamptz remains null in the emitted event rather than becoming the 1970-01-01 timestamp.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.