Im trying to connect to timescaledb, which has a session based pooler on top of, but I keep getting FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute
So I was looking at few places, got a bit confused by Pool
from node-postgres
and what is the actual usage of it.
Currently I have
import type { Connection } from './postgres.connection';
import type { Options } from 'postgres';
import postgres from 'postgres';
export const timescaleConnection = async <T extends Connection = Connection>(
options?: Options<T>,
) => {
const databaseUrl = process.env['TIMESCALE_DATABASE_URL'] ?? '';
return postgres<T>(databaseUrl, {
idle_timeout: 20, // 20 seconds
...options,
});
};
What should I be doing? Using Pool or any other method of configuration?