get_relations_by_pattern no longer works with foreign data wrappers in postgres #357
Closed
1 of 5 tasks
Labels
bug
Something isn't working
cross-db
Tooling to provide consistent behaviour across multiple databases
help wanted
Describe the bug
While upgrading to 0.6.4 from 0.6.3, we hit an issue that is similar to #350 but for a postgres target that had foreign data wrappers set up while using
get_relations_by_pattern
Steps to reproduce
Setup an imported schema
extdb_extschema
in postgres target database with table that matches'%_'+table_suffix
.Reference in model to
get_relations_by_pattern
:Run
dbt compile
on model for target databaseExpected results
The successfully retrieves the set of relations to iterate over creating a single model out of the records in the matching tables (e.g.
union all
of matching relations).This is the current result when running dbt utils
0.6.3
Actual results
Unhandled runtime errors occur during the
get_relations_by_pattern
call causing the model to not build.Screenshots and log output
System information
The contents of your
packages.yml
file:dbt version:
0.19.1
Which database are you using dbt with?
The output of
dbt --version
:Additional context
The addition of
table_type
into thedefault__get_tables_by_pattern_sql
macro causes problems with foreign tables in postgres since they have a type ofFOREIGN
ininformation_schema
, butdbt
doesn't support that type by that name.Are you interested in contributing the fix?
Yeah. I'm not sure if there are any caveats about what the
external
type means indbt
core or weird downstream effects of it, but a similar fix to #351 should solve the problem unless there are concerns about ramifications in other adapters.The text was updated successfully, but these errors were encountered: