get_relations_by_prefix() appears to be broken on Postgres when the database name contains e.g. a hyphen.
Steps to reproduce
Use the following in a database of which the name contains a hyphen.
{% set relations = dbt_utils.get_relations_by_prefix('some_schema', 'prefix') %}
Expected results
19:03:39 Completed successfully
Actual results
18:55:53 Finished running 1 table model, 1 project hook in 0 hours 0 minutes and 2.15 seconds (2.15s).
18:55:53
18:55:53 Completed with 1 error and 0 warnings:
18:55:53
18:55:53 Database Error in model some_model (models/kpis.sql)
syntax error at or near "-"
LINE 19: from foo-bar.information_schema.tables
Describe the bug
get_relations_by_prefix()
appears to be broken on Postgres when the database name contains e.g. a hyphen.Steps to reproduce
Use the following in a database of which the name contains a hyphen.
Expected results
Actual results
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
Are you interested in contributing the fix?
PR is here: https://github.com/dbt-labs/dbt-utils/pull/899