How do I reference a specific DB?

I'm trying to build a query in Snowflake for Retool but I can't get the database name to work.

Here is an example query:

SELECT
    users.id,
    notification_settings.id as setting_id,
    user_id,
FROM 
  fivetran_database.heroku_postgres_public.users

How can I make it so I don't have to specify fivetran_database.heroku_postgres_public each time? Having to specify it for EVERY table is annoying.

Here's a screenshot, as I've already specified a database.

Hey @Amir_Sharif! That field should allow you to specify the db you want to query (and override the default), but does not allow you to provide the SCHEMA. In your use case, you can leave fivetran_database in the Override DB name field, and then omit it in your query. But you would still need to reference the SCHEMA in the query ie: HEROKU_POSTGRES_PUBLIC.

ie: With fivetran_database as the new db name, your SQL should reference HEROKU_POSTGRES_PUBLIC.users

1 Like