Jump to content
Fórum Script Brasil
  • 0

Erro ao realizar backup (Dumping database)



Bom Dia, estou a um tempo tentando realizar o backup de um banco PostgreSQL e está retornando a mensagem de erro abaixo:

[[email protected] ~]# nomeSistema-rake nomeSistema:backup:create

Dumping database ...
Dumping PostgreSQL database nomeSistemahq_production ...

pg_dump: Dumping the contents of table "nomeTabela" failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR:  unexpected chunk number 1 (expected 0) for toast value 107647 in pg_toast_88114
pg_dump: The command was: COPY public.nomeTabela (nomeTabela_id, relative_order, new_nomeTabela, renamed_nomeTabela, deleted_nomeTabela, too_nomeTabela, a_nomeTabela, b_nomeTabela, new_nomeTabela, old_nomeTabela, nomeTabela_diff, "binary") TO stdout;
rake aborted!
Backup::Error: Backup failed
/opt/nomeSistema/embedded/service/nomeSistema-rails/lib/backup/database.rb:49:in `dump'
/opt/nomeSistema/embedded/service/nomeSistema-rails/lib/tasks/nomeSistema/backup.rake:99:in `block (4 levels) in <top (required)>'
/opt/nomeSistema/embedded/service/nomeSistema-rails/lib/tasks/nomeSistema/backup.rake:10:in `block (3 levels) in <top (required)>'
/opt/nomeSistema/embedded/bin/bundle:23:in `load'
/opt/nomeSistema/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => nomeSistema:backup:db:create
(See full trace by running task with --trace)


Pesquisando em alguns sites, vi que o problema pode ser algumas tuplas corrompidas, vi que pedem para criar a função de checagem, logo abaixo, para descobrir o CTID para somente depois realizar o delete dessas tuplas com o comando DELETE FROM nomeTabela WHERE CTID IN(SELECT CTID FROM nomeTabela LIMIT 2 OFFSET 88114); . Só que mesmo executando esses passos, ao realizar o backup, continuo com a mesma mensagem de erro. Alguém pode auxiliar a descobrir o que realmente está causando problema ao executar o backup?

create function chk(anyelement)
   returns bool
language plpgsql as $f$
    declare t text;
    begin t := $1;
      return false;
      exception when others then return true;


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...