Git Product home page Git Product logo

pg-dump-restore's People

Contributors

atlanteh avatar jasv18 avatar nick-riggs avatar pavel-lb1 avatar redwert avatar talk2cerlin avatar teawithfruit avatar vipr0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pg-dump-restore's Issues

New version to NPM

Hi @redwert,

Is it possible, that you push a new version with the improvements from yesterday to NPM?

Thanks!

how to use it with knex?

First of all, thank you for your contribution.

I am using strapi, which from what I have seen uses knex as orm, I would like to know how I can use it with knex instead of sequelize.

Error using pg-dump-restore: `ENOENT` for `pg_dump` command

I encountered an error when attempting to use the pg-dump-restore library to dump a PostgreSQL database. The process fails with an ENOENT error for the pg_dump command.

Error Message

{
  'full error :>> ': Error: Command failed with ENOENT: pg_dump --dbname=postgresql://postgres:sudo@localhost:5432/testeprod --format=custom --file=./dump.sql
  spawn pg_dump ENOENT
      at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
      at __node_internal_errnoException (node:internal/errors:623:12)
      at ChildProcess._handle.onexit (node:internal/child_process:283:19)
      at onErrorNT (node:internal/child_process:476:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawn pg_dump',
    path: 'pg_dump',
    spawnargs: [
      '--dbname=postgresql://postgres:sudo@localhost:5432/testeprod',
      '--format=custom',
      '--file=./dump.sql'
    ],
    originalMessage: 'spawn pg_dump ENOENT',
    shortMessage: 'Command failed with ENOENT: pg_dump --dbname=postgresql://postgres:sudo@localhost:5432/testeprod --format=custom --file=./dump.sql\n' +
      'spawn pg_dump ENOENT',
    command: 'pg_dump --dbname=postgresql://postgres:sudo@localhost:5432/testeprod --format=custom --file=./dump.sql',
    escapedCommand: 'pg_dump "--dbname=postgresql://postgres:sudo@localhost:5432/testeprod" "--format=custom" "--file=./dump.sql"',
    exitCode: undefined,
    signal: undefined,
    signalDescription: undefined,
    stdout: '',
    stderr: '',
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
}
image

Steps to Reproduce

  1. Installed pg-dump-restore via yarn.
  2. Attempted to dump a PostgreSQL database using the provided syntax in the library documentation.
  3. The process failed with the error message above.
image

Expected Behavior

The library should successfully initiate a dump of the specified PostgreSQL database using pg_dump.

Actual Behavior

The command fails with an ENOENT error, indicating that pg_dump could not be found or executed.

Environment

  • Node.js version: v18.17.1
  • Operating System: MacOs Sonoma 14.0

Examples of tablePattern

Hi, I am trying to use tablePattern option

Example table names I'm trying to match [ UserManagementSystem, UserLoginSystem, UserSessionSystem ]

what I have tried is tablePattern="User*" but no match is found

pg_dump: error: no matching tables were found

or

how to achieve something like pg_dump myDatabase -t table1 -t table2 > backup.sql;

Any help appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.