sql.to() function not working in V2.4.0

This Flux sql.to() function did not report any errors in V2.4, but the data was not written to PGSQL
it is working in old V2.0.7.

import “sql”
data = from(bucket: “SEMW”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “Welding”)
|> filter(fn: (r) => r[“_field”] == “WeldResult”)
|> aggregateWindow(every: 1m, fn: last, createEmpty: false)
|> yield(name: “last”)

data
|> sql.to(
driverName: “postgres”,
dataSourceName: “postgresql://postgres:e82e0c77a0eb@10.177.108.247:5432/analytic_data?sslmode=disable”,
table: “espc.sample_data”)

Hello @FrankSONG,
Welcome!
Hmm that seems odd.
@scott do you know anything about this?

The addition of quotes was added to Flux v0.150.0 via bugfix [1]. This was done with security in mind, particularly injection vulnerabilities.
The goal is to make sure identifiers being added to our SQL statements are quoted and escaped.

1 Like

@Anaisdg Please look at the last message