risingwave icon indicating copy to clipboard operation
risingwave copied to clipboard

bug: PG generated column incorrectly fallback to expression evaluation

Open MrCroxx opened this issue 10 months ago • 0 comments

Describe the bug

In PG:

CREATE TABLE foos (
    id SERIAL PRIMARY KEY,
    height_cm NUMERIC,
    height_in NUMERIC GENERATED ALWAYS AS (height_cm / 2.54) STORED
);
INSERT INTO foos(height_cm) VALUES (100);
select * from foos;

Got:

 id | height_cm |      height_in      
----+-----------+---------------------
  1 |       100 | 39.3700787401574803

In RW:

CREATE TABLE foos (id INT  PRIMARY KEY, height_cm NUMERIC, height_in NUMERIC) FROM "primary_cdc" TABLE 'public.foos';
select * from foos;

Got:

 id | height_cm | height_in 
----+-----------+-----------
  1 |       100 |          

The height_in column is NULL.

Error message/log

2025-06-16T21:24:05.494375059+08:00  WARN risingwave_connector_node: Cannot parse column default value '(height_cm / 2.54)' to type 'numeric'. Expression evaluation is not supported. thread="debezium-postgresconnector-RW_CDC_10-change-event-source-coordinator" class="io.debezium.connector.postgresql.connection.PostgresDefaultValueConverter"

To Reproduce

No response

Expected behavior

Same result as PG.

How did you deploy RisingWave?

No response

The version of RisingWave

No response

Additional context

No response

MrCroxx avatar Jun 16 '25 13:06 MrCroxx