Skip to content

dbExistsTable fails on Amazon Redshift #211

Closed

Description

@ilyaminati

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.

Activity

  1. krlmlr commented on Mar 3, 2019

    @krlmlr
    Member

    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"
    )

  2. ilyaminati commented on Mar 4, 2019

    @ilyaminati
    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?

  3. krlmlr commented on Mar 17, 2019

    @krlmlr
    Member

    Sure, but will this work for Postgres?

  4. krlmlr commented on Dec 17, 2019

    @krlmlr
    Member

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

  5. github-actions commented on Dec 17, 2020

    @github-actions
    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.

  6. locked and limited conversation to collaborators on Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions