Project

General

Profile

Actions

Bug #17974

open

PostgreSQL restore task is executed twice

Added by Lukas Zapletal over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Rake tasks
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In the postgres_import method, we run the pg_restore twice. Second run will likely fail.

  def postgres_import(file, config)
    cmd = "pg_restore -d #{config['database']} -U #{config['username']} --clean" 
    cmd += " -h #{config['host']} " if config['host'].present?
    cmd += " -p #{config['port']} " if config['port'].present?
    cmd += " #{file}" 
    system({'PGPASSWORD' => config['password']}, cmd)
    system(cmd)
  end

Also it's not clear if users should migrate database first (then we are missing --data-only option) or users should make sure database is created prior restore (then they need to call something like db:drop).

No data to display

Actions

Also available in: Atom PDF