fix - for import quert for pg when need escaping

This commit is contained in:
johnnyfish
2024-08-28 13:31:52 +03:00
committed by Jonathan Fishner
parent 722254924d
commit c7f0afc246
2 changed files with 2 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ cols as (
ELSE 'null'
END,
',"nullable":', case when (cols.IS_NULLABLE = 'YES') then 'true' else 'false' end,
',"default":"', COALESCE(replace(replace(cols.column_default, '"', E'\\"'), '\\x', '\\\\x'), ''),
',"default":"', COALESCE(replace(replace(cols.column_default, '"', '\\"'), '\\x', '\\\\x'), ''),
'","collation":"', coalesce(cols.COLLATION_NAME, ''), '"}')), ',') as cols_metadata
from information_schema.columns cols
where cols.table_schema not in ('information_schema', 'pg_catalog')