I have a multi-line table comment, such as
COMMENT ON TABLE foo IS '
Roses are red
Violets are blue
Redshift doesn''t mind long comments
And so shouldn''t you
';
When this is exported via v_generate_tbl_ddl, it comes out as:
COMMENT ON table foo IS '
Roses are red
Violets are blue
Redshift doesn't mind long comments
And so shouldn't you
';
Notice that both contractions are no longer correctly doubling up '', which results in a syntax error when I try to run the generated DDL. I expected the generated DDL to correctly escape these quotes in a comment.
I haven't had time to look into this, including:
- Whether it matters that there are exactly a balanced pair of apostrophes, or whether this would work with just one apostrophe, or if you just need more than one apostrophe
- Whether it matters that it's multi-line
- Whether it could affect e.g. column comments
Thanks for giving us a way to get DDL out of Redshift!
I have a multi-line table comment, such as
When this is exported via
v_generate_tbl_ddl, it comes out as:Notice that both contractions are no longer correctly doubling up
'', which results in a syntax error when I try to run the generated DDL. I expected the generated DDL to correctly escape these quotes in a comment.I haven't had time to look into this, including:
Thanks for giving us a way to get DDL out of Redshift!