diff --git a/packages/malloy/src/dialect/postgres/postgres.ts b/packages/malloy/src/dialect/postgres/postgres.ts index 2ed407e2e..7b4fe75fa 100644 --- a/packages/malloy/src/dialect/postgres/postgres.ts +++ b/packages/malloy/src/dialect/postgres/postgres.ts @@ -457,8 +457,7 @@ export class PostgresDialect extends PostgresBase { } sqlLiteralArray(lit: ArrayLiteralNode): string { - // mtoy todo real quoting of values ... strings with quotes will break thi const array = lit.kids.values.map(val => val.sql); - return `'${JSON.stringify(array)}'::jsonb`; + return `ARRAY[${array.join(',')}]`; } } diff --git a/test/src/databases/all/compound-atomic.spec.ts b/test/src/databases/all/compound-atomic.spec.ts index 2418b2cda..2f966392c 100644 --- a/test/src/databases/all/compound-atomic.spec.ts +++ b/test/src/databases/all/compound-atomic.spec.ts @@ -125,7 +125,7 @@ describe.each(runtimes.runtimeList)( const nameOfArrayLenFunction = { 'duckdb': 'LEN', 'standardsql': 'ARRAY_LENGTH', - 'postgres': 'JSONB_ARRAY_LENGTH', + 'postgres': 'CARDINALITY', 'presto': 'CARDINALITY', 'trino': 'CARDINALITY', 'mysql': 'JSON_LENGTH',