amazon-redshift-utils icon indicating copy to clipboard operation
amazon-redshift-utils copied to clipboard

v_generate_tbl_ddl incorrectly pulls comments on tables with same name in different schema

Open mkellar3 opened this issue 1 year ago • 0 comments

v_generate_tbl_ddl pulls comments for tables with the same name in different schemas as the join to information_schema."columns" is only joining on table name. Correct this by adding a condition to join on schema as well as shown below:

OLD Line 273: ON cl.ordinal_position::integer = des.objsubid AND cl.table_name::NAME = c.relname

NEW Line 273: ON cl.ordinal_position::integer = des.objsubid AND cl.table_name::NAME = c.relname AND cl.table_schema = n.nspname

mkellar3 avatar Dec 08 '23 19:12 mkellar3