You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
s-p-sathish
changed the title
Failed to connect to the database error: invalid page in block 22 of relation base/12971/2674
invalid page in block 22 of relation base/12971/2674
Dec 5, 2024
While running any cerate db queries I am getting the above error
sample code for reproduce the issue
const { Client } = require('pg');
const { PostgresMock } = require('pgmock');
const client = new Client({
user: "postgres",
host: "localhost",
database: "postgres",
password: "pgmock",
port: "5432",
});
async function connectToDatabase() {
try {
const mock = await PostgresMock.create();
const connectionString = await mock.listen(5432);
console.log("connectionString" + connectionString);
await client.connect();
console.debug("Connected to the postgres database named: " + "postgres");
await client.query(
CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) )
);console.log("Table created successfully");
} catch (err) {
console.error("Failed to connect to the database", err);
throw err;
}}
connectToDatabase();
The text was updated successfully, but these errors were encountered: