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

dbExistsTable fails on Amazon Redshift #211

Closed
ilyaminati opened this issue Feb 21, 2019 · 5 comments
Closed

dbExistsTable fails on Amazon Redshift #211

ilyaminati opened this issue Feb 21, 2019 · 5 comments
Labels

Comments

@ilyaminati
Copy link

dbExistsTable on Redshift returns:

Error in result_create(conn@ptr, statement) :
Failed to prepare query: ERROR: function generate_subscripts(name[], integer) does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.

This is likely because generate_subscripts is unsupported on Redshift.

@krlmlr krlmlr added the bug label Mar 3, 2019
@krlmlr
Copy link
Member

krlmlr commented Mar 3, 2019

Thanks. I'm not familiar with RedShift, can you suggest an alternative query?

RPostgres/R/tables.R

Lines 269 to 276 in e09b014

query <- paste0(
"(SELECT nr, schemas[nr] AS table_schema FROM ",
"(SELECT *, generate_subscripts(schemas, 1) AS nr FROM ",
"(SELECT current_schemas(true) AS schemas) ",
"t) ",
"tt WHERE schemas[nr] <> 'pg_catalog') ",
"ttt"
)

@ilyaminati
Copy link
Author

Sorry, I no longer have access to a Redshift instance, I'm no help here. But what's the reason for doing such a search in the first place? For dbExistsTable, is it not sufficient to just query against PG_TABLE_DEF?

@krlmlr
Copy link
Member

krlmlr commented Mar 17, 2019

Sure, but will this work for Postgres?

@krlmlr
Copy link
Member

krlmlr commented Dec 17, 2019

We don't currently support Redshift very well. Closing in favor of #215.

@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants