s0phr0syn3
08/18/2025, 4:34 PMtime data type. Since I'm replicating to TimescaleDB which is also Postgres, in theory I should be able to retain the same data type but it gets converted to varchar in the destination table. This would be fine if it wasn't adding some random date ("0000-01-01") to the field. Is there a way to disable inference for a couple fields in the config YAML? Or does it have to be managed with custom SQL with an explicit cast to text for the time columns? I was hoping to avoid that since I use SELECT * to pick up all columns in case of changes to the source. Thanks in advance.s0phr0syn3
08/18/2025, 4:51 PMtime but in the destination table, the same record is "0000-01-01T02:00:00Z" with data type character varying. I know I can probably do some substring parsing to extract the time value but I was just wondering why Postgres to Postgres doesn't retain the native time type.s0phr0syn3
08/18/2025, 4:52 PMSELECT split_part(split_part(time_column, 'T', 2), 'Z', 1); does seem to do the trick as a workaround.flarco
08/18/2025, 8:36 PMtime is not currently handled by sling, see https://github.com/slingdata-io/sling-cli/blob/main/core/dbio/templates/types_general_to_native.tsv
it looks like the golang postgres driver actually does receive it as a timestamp with year 0, month 1, day 1, which is interesting.
It is on the roadmap to allow some flexibility in handling more "rare" native types. So you'll have to do some extra workaround for now.s0phr0syn3
08/18/2025, 8:39 PMflarco
08/18/2025, 9:57 PM