Skip to content

Rollback issues #1854

@madeken

Description

@madeken

This program will never terminate, as the rollback query infinitely blocks:

const { Pool } = require('pg')
const pool = new Pool()

async function main() {

  const client = await pool.connect()

  try {
    await client.query('BEGIN');
    await client.query('SELECT $1', [{x: 1n}]);
    await client.query('COMMIT')
  } catch (e) {
    await client.query('ROLLBACK')
    throw e
  } finally {
    client.release()
  }

  console.log('great success! Terminated!');
}

main();

Note, the value 1n works, {x: 1} works, but {x: 1n} is where the problems start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions