PostgreSQL Error with LTree

52 views
Skip to first unread message

Robin Tang

unread,
May 20, 2023, 2:54:21 PM5/20/23
to debe...@googlegroups.com
Hey folks,

I'm observing this error on Debezium Server 2.0 and 2.2.

In the same `postgres` example image, I modify to add a `ltree` column, and Debezium is returning null.

```

CREATE EXTENSION IF NOT EXISTS ltree;

ALTER TABLE inventory.customers ADD COLUMN ltree_test ltree;

UPDATE inventory.customers set ltree_test = 'Top' where id = 1001;

UPDATE inventory.customers set ltree_test = 'Top.Science' where id = 1002;

UPDATE inventory.customers set ltree_test = 'Top.Science.Astrononmy4' where id = 1003;

```



Error:


debezium-server               | {"timestamp":"2023-05-20T18:52:07.367Z","sequence":206,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.debezium.connector.postgresql.TypeRegistry","level":"INFO","message":"Failed to obtain SQL type information for type ltree via custom statement, falling back to TypeInfo#getSQLType()","threadName":"debezium-postgresconnector-dbserver1-change-event-source-coordinator","threadId":31,"mdc":{"dbz.taskId":"0","dbz.databaseName":"postgres","dbz.connectorName":"dbserver1","dbz.connectorType":"Postgres","dbz.connectorContext":"streaming"},"ndc":"","hostName":"95f36458be77","processName":"io.debezium.server.Main","processId":1}



Any ideas why this is happening?


Thanks,

Robin

jiri.p...@gmail.com

unread,
May 22, 2023, 9:36:05 AM5/22/23
to debezium
Hi,

this should be irrelevant to the fact it is Debezium Server. I tried it with ou tutorial and it seems to be working. Could you please try it yourself and check if it works on tutorial for you and if not then provide the exact steps for us to reproduce, esp. when should be each action done.

Thanks

Robin Tang

unread,
May 31, 2023, 10:58:42 AM5/31/23
to debe...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/218ec467-e899-4de7-bed1-98073b64c93dn%40googlegroups.com.

Robin Tang

unread,
May 31, 2023, 1:27:14 PM5/31/23
to debe...@googlegroups.com
I am currently debugging this and I suspect the culprit is because `data` is actually NULL.

logger.info("#### ltree col:" + column + "### data: " + data + "### fieldDefn " + fieldDefn);

debezium-server               | {"timestamp":"2023-05-31T17:26:10.272Z","sequence":211,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"io.debezium.connector.postgresql.PostgresValueConverter","level":"INFO","message":"#### ltree col:ancestry_path ltree(2147483647, 0) DEFAULT VALUE NULL### data: null### fieldDefn Field{name=ancestry_path, index=4, schema=Schema{io.debezium.data.Ltree:STRING}}","threadName":"debezium-postgresconnector-dbserver1-change-event-source-coordinator","threadId":31,"mdc":{"dbz.taskId":"0","dbz.databaseName":"postgres","dbz.connectorName":"dbserver1","dbz.connectorType":"Postgres","dbz.connectorContext":"streaming"},"ndc":"","hostName":"239e59ee80e5","processName":"io.debezium.server.Main","processId":1}

Any idea why this is happening?

Thanks in advance!
Robin

Robin Tang

unread,
May 31, 2023, 1:57:47 PM5/31/23
to debezium
Just found out more.

1) This is an issue with streaming ongoing LTree column changes.
2) Initial snapshot is actually fine
3) When I added debezium.source.include.unknown.datatypes=true which will include all unknown data types and just cast it as a STRING, it works.

Seems to me like there's a bug with custom data types <> streaming.

Chris Cranford

unread,
Jun 1, 2023, 3:52:26 PM6/1/23
to debe...@googlegroups.com
Hi Robin -

I just checked our "ltree" test and I concur I see the same behavior, it gets exported successfully during snapshot without the unknown data-type toggle, but is omitted during streaming.  Ideally this should work similarly regardless of phase, could you please raise a Jira?

Thanks,
Chris

Robin Tang

unread,
Jun 4, 2023, 2:06:25 PM6/4/23
to debezium
Reply all
Reply to author
Forward
0 new messages