question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`No such table: information_schema.sequence` error on `npx prisma db pull` for Amazon RedShift

See original GitHub issue

Bug description

I am attempting to connect a Redshift database to Prisma using the postgresql drivers. I did the setup as outlined here successfully. i followed the database url instructions found here with my credentials matching the following pattern:

postgresql://username:password@abc-12-345-67-890.eu-west-1.redshift.amazonaws.com:1234/databaseName?schema=foo&readOnlyMode=always

i run DEBUG="*" npx prisma db pull and i get the following error:

 prisma:engines binaries to download libquery-engine, migration-engine, introspection-engine, prisma-fmt +0ms
Prisma schema loaded from prisma/schema.prisma
  prisma:loadEnv project root found at ./package.json +0ms       
  prisma:tryLoadEnv Environment variables loaded from ./.env +0ms
Environment variables loaded from .env
  prisma:getConfig Using CLI Query Engine (Node-API Library) at: ./node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node +0ms
Datasource "db": PostgreSQL database "databaseName", schema "foo" at "abc-12-345-67-890.eu-west-1.redshift.amazonaws.com:1234"

Introspecting based on datasource defined in prisma/schema.prisma …
  prisma:introspectionEngine:rpc starting introspection engine with binary: ./node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x +0ms
  prisma:introspectionEngine:rpc SENDING RPC CALL {"id":1,"jsonrpc":"2.0","method":"introspect","params":[{"schema":"// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n  provider = \"prisma-client-js\"\n}\n\ndatasource db {\n  provider = \"postgresql\"\n  url      = env(\"DATABASE_URL\")\n}\n"}]} +21ms
  prisma:introspectionEngine:rpc {
  prisma:introspectionEngine:rpc   jsonrpc: '2.0',
  prisma:introspectionEngine:rpc   error: {
  prisma:introspectionEngine:rpc     code: 4466,
  prisma:introspectionEngine:rpc     message: 'An error happened. Check the data field for details.',
  prisma:introspectionEngine:rpc     data: {
  prisma:introspectionEngine:rpc       is_panic: false,
  prisma:introspectionEngine:rpc       message: 'Error in connector: Error querying the database: Error querying the database: No such table: information_schema.sequences',
  prisma:introspectionEngine:rpc       backtrace: null
  prisma:introspectionEngine:rpc     }
  prisma:introspectionEngine:rpc   },
  prisma:introspectionEngine:rpc   id: 1
  prisma:introspectionEngine:rpc } +868ms

Error: Error: Error in connector: Error querying the database: Error querying the database: No such table: information_schema.sequences

    at Object.<anonymous> (./node_modules/prisma/build/index.js:46523:29)
    at Object.handleResponse ./node_modules/prisma/build/index.js:46401:38)
    at LineStream4.<anonymous> (./node_modules/prisma/build/index.js:46479:20)
    at LineStream4.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at LineStream4.Readable.push (node:internal/streams/readable:228:10)
    at LineStream4._pushBuffer (./node_modules/prisma/build/index.js:46244:21)
    at LineStream4._transform (./node_modules/prisma/build/index.js:46238:12)
    at LineStream4.Transform._write (node:internal/streams/transform:184:23)

i use the same database url for my current postgres drivers with KnexJS, and would like to migrate to Prisma for it’s ability to sync data models with my database.

How to reproduce

  1. have a Redshift database that you can connect to with postgres drivers
  2. initialize Prisma for an existing project
  3. run DEBUG="*" npx prisma db pull
  4. see error

Expected behavior

I expect the initialization to happen without an error.

Prisma information

from .env:

# Environment variables declared in this file are automatically made available to Prisma.

# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB (Preview) and CockroachDB (Preview).

# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="postgresql://username:password@abc-12-345-67-890.eu-west-1.redshift.amazonaws.com:1234/databaseName?schema=foo&readOnlyMode=always"

from schema.prisma:


// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Environment & setup

  • OS: Windows 10, 64-bit, WSL1 using Ubuntu 18.04
  • Database: Redshift with Postgresql drivers
  • Node version: v16.13.2

Prisma Version

Environment variables loaded from .env
prisma                  : 3.9.2
@prisma/client          : Not found
Current platform        : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine        : migration-engine-cli bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine    : introspection-core bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary           : prisma-fmt bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash    : bcc2ff906db47790ee902e7bbc76d7ffb1893009
Studio                  : 0.457.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
wildkycommented, Aug 29, 2022

FYI Also trying to use Prisma with Redshift and ran into this bug.

@MJGTwo I’m wondering if you have a work around or are you just not using Prisma for this use case?

1reaction
janpiocommented, Feb 18, 2022
  • does the ?schema=public always have to be equal to public? for my usage, i have the value analytics to make DBeaver work because that schema contains the tables I an querying against

No, that is indeed a supported feature of Prisma that you can set whatever schema name you want there.

  • do I need to have readOnly=true or readOnlyMode=always to make Prisma read only for Redshift?

Most probably not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

relation "information_schema.sequences" does not exist ...
But whenever I am starting the application I am getting below error. Caused by: java.sql.SQLException: [Amazon](500310) Invalid operation: ...
Read more >
“Illuminate\Database\QueryException SQLSTATE[HY000 ...
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = e-tag and table_name = migrations and ...
Read more >
Profile for Microsoft - Linknovate
An entity is simply an object wrapper for a database table. ... MSSQL, MySQL, MariaDB, SQLite3, Oracle, and Amazon Redshift Knex.js is currently...
Read more >
java ahmed | thiscodeWorks
nextInt(); System.out.println("sum=" + (n1 + n2));//not n1+n2 } } import java.util.Scanner; public class Ahmedjava { public static void main(String[] args) ...
Read more >
The Best of Tutorial and Learning http code list Code Example
PGSQL.5432" failed: No such file or directory Is the server running locally and accepting ... 'aws' is not recognized as an internal or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found