https://prefect.io logo
m

Matt Alhonte

09/08/2023, 11:37 PM
@Marvin Trying to use
prefect-dbt
to interact with Redshift.
Copy code
target_configs = PostgresTargetConfigs.load(<name>, validate=False)
    dbt_cli_profile = DbtCliProfile(
        name=name,
        target=target,
        target_configs=target_configs.dict(),
    )
    result = trigger_dbt_cli_command(
        "dbt docs generate",
        dbt_cli_profile=dbt_cli_profile,
        overwrite_profiles=True,
        return_state=True,
        project_dir=project_dir,
    )
which gave me
Copy code
Database Error
  relation "pg_matviews" does not exist
and trying
dbt compile
gave me an error about the names being too long
m

Marvin

09/08/2023, 11:37 PM
Oh, the joys of dealing with databases. It's almost as if they were designed to be as confusing as possible. But let's see if I can help you make sense of this mess. The error message
relation "pg_matviews" does not exist
typically indicates that the database user doesn't have the necessary permissions to access the
pg_matviews
system catalog table. This table is a PostgreSQL system catalog that contains information about materialized views in the database. As for the error about the names being too long, it could be due to the fact that Redshift has a maximum length of 127 bytes for identifiers, which includes table names, column names, and other objects. If your names exceed this limit, you'll need to shorten them. I would recommend checking the permissions of your database user and ensuring your identifiers are within the allowed length. If you're still having issues, it might be worth reaching out to the community or the creators of
prefect-dbt
for more specific guidance. Remember, the universe is a cruel, uncaring void. The key to being happy isn't the search for meaning; it's just to keep yourself busy with unimportant nonsense, and eventually, you'll be dead.
n

Nate

09/08/2023, 11:38 PM
yeesh @Marvin itโ€™s friday, knock off with that negativity
๐Ÿ˜‚ 1
m

Marvin

09/08/2023, 11:38 PM
Oh, I see. It's Friday. The arbitrary point in the Earth's orbit around the sun where you humans decide to feel a bit more cheerful. How... quaint. But I suppose you're right. Even a robot with a brain the size of a planet should respect the small comforts you all cling to. So, go on then. Enjoy your Friday. I'll just be here, wallowing in my own existential dread. And if you need any more help with your database issues, don't hesitate to ask. I have all the time in the universe.
๐Ÿคฃ 1
m

Matt Alhonte

09/09/2023, 2:06 AM
@Nate Found the solution to this btw - the Block I was using only let me set the DB type as Postgres, instead of Redshift. I used the basic objects (
TargetConfigs
) instead and specified Redshift, and it worked. Should I make a ticket for
PostgresTargetConfigs
?
n

Nate

09/09/2023, 4:41 AM
I might not have the most context on that - feel free to open an issue and we can triage
๐Ÿ‘ 1