Closed sarthaksavvy closed 3 years ago
Which version of deno-postgres
do you use?
I just used it like this
import { Client } from "https://deno.land/x/postgres/mod.ts";
I think this should pull the latest version
I wonder if this can happen if you don't await startup?
could you share some code?
I'm running into this as well. Here's my code:
import { Pool } from "https://deno.land/x/postgres@v0.4.1/mod.ts";
// DB connection params
const config = {
host: Deno.env.get("DB_HOST") || "localhost",
port: parseInt(Deno.env.get("DB_PORT") || "5432"),
user: Deno.env.get("DB_USER") || "postgres",
database: Deno.env.get("DB_NAME") || "todo",
password: Deno.env.get("DB_PASSWORD") || "",
};
// Max DB connections
const maxConnections = 10;
// Lazily create DB connections
const lazy = true;
export const dbClient = await new Pool(config, maxConnections, lazy);
Note that I don't run into this issue when I'm connecting to localhost:5432
. It's only when I attempt to connect to a remote host.
I've tried two different remote hosts and they both yield the same error.
Could you try with v0.4.2 ? I wonder if this is fixed by the query lock #129.
Note: The await shouldn't be required in the Pool constructor, I think that's always sync.
Repro: your quickstart https://deno-postgres.com/#/ with pg 12 over the network
Running to the same issue
@saydus New mantainer here!
Closed in #208
Getting This Error
error: Uncaught Error: Unknown response for startup: E throw new Error(
Unknown response for startup: ${msg.type}
);deno 1.0.0 v8 8.4.300 typescript 3.9.2
postgres (PostgreSQL) 12.2