Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to Redshift table using db_tbl() #538

Open
dsen6644 opened this issue Jun 10, 2024 · 0 comments
Open

Unable to connect to Redshift table using db_tbl() #538

dsen6644 opened this issue Jun 10, 2024 · 0 comments
Assignees

Comments

@dsen6644
Copy link

I can connect to my table in redshift using the following:

conn <- DBI::dbConnect(drv = RPostgres::Postgres(),
                       dbname = 'my-db-name',
                       host = 'su-dl-cluster.my-host.us-west-2.redshift.amazonaws.com',
                       port = 5439,
                       user = Sys.getenv("AWS_REDSHIFT_UID_FULL"),
                       password = Sys.getenv("AWS_REDSHIFT_PWD_FULL"))

table_df <- dplyr::tbl(conn, dbplyr::in_schema("my_schema", "my_table"))

Subbing in the credentials above, I am not able to connect to the the same table using db_tbl()

my_db_tbl <- db_tbl(table = c(schema = "my_schema", table = "my_table"),
                    dbtype = "postgres",
                    dbname = "my-db-name",
                    host = "su-dl-cluster.my-host.us-west-2.redshift.amazonaws.com",
                    port = 5439,
                    user = Sys.getenv("AWS_REDSHIFT_UID_FULL"),
                    password = Sys.getenv("AWS_REDSHIFT_PWD_FULL"))

What I get is the following error:

Error: could not connect to server: Connection timed out
	Is the server running on host "su-dl-cluster.my-host.us-west-2.redshift.amazonaws.com" (10.100.1.248) and accepting
	TCP/IP connections on port 5432?

I am unsure why the warning message would state port 5432 when I supplied 5439 as my port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants