Skip to content

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

@mkellar3

Description

@mkellar3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions