Error from toc entry

Error from toc entry Добрый день. Стояла RADHAT5 что-то случилось с фйаловой системой. Пришел человек и установил SLACKWARE13 перенес postgres и сервер 1с. Запустил это все дело и ушел. Теперь нужно настроить автоархивирование (pg_dump+cron). коммандой pg_dump -U postgres -Fc -Z9 -f BACKNAME DBNAME создаются дампы, ошибок в логах ни каких нет. Попыталcя восстановить pg_restore […]

Содержание

  1. Error from toc entry
  2. Сначала
  3. Это уже прочитано. Привожу
  4. Давайте угадаю с одного
  5. Совершенно верно!пункт 1
  6. Тут такая штука. Патченый для
  7. pg_restore: [archiver (db)] could not execute query: ERROR: schema «public» already exists
  8. 6 Answers 6
  9. Восстановление базы 1с Postgress
  10. Почему не восстанавливаются резервные копии?

Error from toc entry

Добрый день.
Стояла RADHAT5 что-то случилось с фйаловой системой. Пришел человек и установил SLACKWARE13 перенес postgres и сервер 1с. Запустил это все дело и ушел. Теперь нужно настроить автоархивирование (pg_dump+cron).
коммандой pg_dump -U postgres -Fc -Z9 -f BACKNAME DBNAME создаются дампы, ошибок в логах ни каких нет. Попыталcя восстановить pg_restore -U postgres -Fc -c -d DBNAME BACKNAME — база восстанавливается с ошибками. Пробовал разные варианты восстанавливал в только-что созданную постгрес БД, из pgAdmin, из 1С, из оснастки управления сервером 1С, результат плачевный. Сделал дамп в sql, так же восстановление проходит с ошибками — восстановленная БД не рабочая. Куда капнуть даже не предполагаю. Подскажите пожалуйста, умные люди.

  • Войдите или зарегистрируйтесь, чтобы добавлять комментарии

Сначала

Сначала прочитайте:
http://postgresql.ru.net/manual/backup.html
далее, если после проработки материала будут ошибки — покажите какие, тогда и будем думать

  • Войдите или зарегистрируйтесь, чтобы добавлять комментарии

Это уже прочитано. Привожу

Это уже прочитано.
Привожу кусок лога при восстановлении

в итоге имеем не рабочую базу.

  • Войдите или зарегистрируйтесь, чтобы добавлять комментарии

Давайте угадаю с одного

Давайте угадаю с одного раза.
Восстанавливаете вы не в старую базу, а в новую, верно?
Кроме того у вас не стандартный PostgtreSQL, а который для 1C — точно?

В общем два рецепта есть как победить проблему:
1. Создавайте новую БД (в которую делаете восстановление) не сами, а с помощью 1C
2. Если создаёте новую БД сами, попробуйте создавать с помощью шаблона, в качестве которого используйте рабочую БД, созданную 1C

  • Войдите или зарегистрируйтесь, чтобы добавлять комментарии

Совершенно верно!пункт 1

Совершенно верно!
пункт 1 пробовал. Этот лог как раз таки с этого варианта, как ни странно.
пункт2 сечас попробую.
попробовал вариант 2 при восстановлении 10 ошибок. 1С сообщает что база не обнаружена.

  • Войдите или зарегистрируйтесь, чтобы добавлять комментарии

Тут такая штука. Патченый для

Тут такая штука. Патченый для 1C PostgreSQL содержит в себе библиотеку для поддержки специального типа данных mchar (mvchar, mvachar). Но если вы создаёте БД руками, этот тип данных в БД не прогружается как и его обвязка (CAST’ы и прочее). Поэтому при восстановлении pg_restore выдаёт ошибки — там используется данный тип, а как с ним работать СУБД не знает.

Т.е. чтобы заработало, надо прогрузить либу в БД, создав данный тип и обвязку к нему. Как сделать это вручную, я к сожалению, не знаю. Но вот что я бы сделал. Включил бы в PostgreSQL логгирование запросов к базе, затем бы создал БД из 1C, затем выключил логгирование и посмотрел какие команды при создании БД попали в лог, относящиеся к mchar. Тогда можно было бы создать пустую БД самому и накатить эти команды, после чего всё должно заработать.

Источник

pg_restore: [archiver (db)] could not execute query: ERROR: schema «public» already exists

I am using pg_dump / pg_restore to backup and restore a PostgreSQL database, but am getting some error messages (and a non-zero exit status) from pg_restore. I tried a super simple base case (outlined below) but still got these errors:

Steps to reproduce:

  1. Install a fresh, vanilla Ubuntu 14.04 distro (I’m using Vagrant with this Vagrant box).
  2. Install PostgreSQL 9.3, configure to allow local connections as PostgreSQL user «postgres» from any Linux user.

Create a test database. I’m just doing:

Create a backup of the database like so:

Delete some rows out of the data table in mydb so we will be able to tell if we restored the data successfully.

Restore the database with:

The data is restored, but the pg_restore command in step 6 exits with status 1 and shows the following output:

I cannot just ignore this because I am running this command programmatically and need to use the exit status to determine if the restore failed or not. Initially, I wondered if this problem was because I put my database in public (the default schema). I reasoned that public would be created as a result of the —create option by pg_restore before the data was restored (which could conceivably try to create that schema as well since that is where my table is), but when I tried the above steps with my table in a different schema, the results were the same and the error messages were identical.

Am I doing something wrong? Why am I seeing this error?

6 Answers 6

The error is harmless but to get rid of it, I think you need to break this restore into two commands, as in:

The —clean option in pg_restore doesn’t look like much but actually raises non-trivial problems.

For versions up to 9.1

The combination of —create and —clean in pg_restore options used to be an error in older PG versions (up to 9.1). There is indeed some contradiction between (quoting the 9.1 manpage):

—clean Clean (drop) database objects before recreating them

—create Create the database before restoring into it.

Because what’s the point of cleaning inside a brand-new database?

Starting from version 9.2

The combination is now accepted and the doc says this (quoting the 9.3 manpage):

—clean Clean (drop) database objects before recreating them. (This might generate some harmless error messages, if any objects were not present in the destination database.)

—create Create the database before restoring into it. If —clean is also specified, drop and recreate the target database before connecting to it.

Now having both together leads to this kind of sequence during your restore:

There is no DROP for each individual object, only a DROP DATABASE at the beginning. If not using —create this would be the opposite.

Anyway this sequence raises the error of public schema already existing because creating mydb from template0 has imported it already (which is normal, it’s the point of a template database).

I’m not sure why this case is not handled automatically by pg_restore . Maybe this would cause undesirable side-effects when an admin decides to customize template0 and/or change the purpose of public , even if we’re not supposed to do that.

Источник

Восстановление базы 1с Postgress

хорошо попробую.
Вот создал новую базу и в нее восстановил с помощью pgAdmin/ он по умолчанию сделал такой командой:
C:Program Files (x86)PostgreSQL8.4.3-3.1Cbinpg_restore.exe -i -h localhost -p 5432 -U postgres -d «BuhTemp» -v «F:postgres_backupBUH_120725.backup»

В итоге куча ошибок. и база не восстановлена, даже конфигуратор не открывается.
.
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 5256; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR: language «plpgsql» already exists

Command was:
CREATE PROCEDURAL LANGUAGE plpgsql;
pg_restore: creating SHELL TYPE chkpass
pg_restore: [archiver (db)] Error from TOC entry 1230; 0 0 SHELL TYPE chkpass postgres
pg_restore: [archiver (db)] could not execute query: ERROR: type «chkpass» already exists
.
pg_restore: creating FUNCTION isnge(ean13, upc)
pg_restore: [archiver (db)] Error from TOC entry 391; 1255 17237 FUNCTION isnge(ean13, upc) postgres
pg_restore: [archiver (db)] could not execute query: ERROR: function «isnge» already exists with same argument types
Command was: CREATE FUNCTION isnge(ean13, upc) RETURNS boolean
LANGUAGE internal IMMUTABLE STRICT
AS $$int8ge$$;
.
pg_restore: setting owner and privileges for INDEX byosname
pg_restore: setting owner and privileges for INDEX byrolesid
pg_restore: setting owner and privileges for INDEX byshow
WARNING: errors ignored on restore: 6866

Процесс вернул код выхода 1.

создал пустую базу, почему то опять ругается на существующие элементы. и в самом конце вот что выдал:
pg_restore: [archiver (db)] COPY failed: ERROR: out of memory
DETAIL: Failed on request of size 536870912.
CONTEXT: COPY config, line 9419: «e0666db2-45d6-49b4-a200-061c6ba7
-8696-411f-95a1-ef011fdf8da9 2012-03-28 16:49:37 2012-0. »
WARNING: errors ignored on restore: 1130

В итоге база не запускается. конфигуратор открывается но видит пустую конфигурацию

pg_restore: [archiver (db)] Error from TOC entry 13847; 0 361139 TABLE DATA config user1c
pg_restore: [archiver (db)] COPY failed: ERROR: duplicate key value violates unique constraint «config_pkey»
CONTEXT: COPY config, line 1: «d4a1f489-2fba-41f6-ab57-3986f22c7403 2012-03-28 16:50:37 2012-03-28 16:50:37 0 89 <\277<\177\265. »
pg_restore: restoring data for table «configsave»
pg_restore: restoring data for table «dbschema»
pg_restore: restoring data for table «files»
pg_restore: [archiver (db)] Error from TOC entry 13850; 0 377251 TABLE DATA files user1c
pg_restore: [archiver (db)] COPY failed: ERROR: duplicate key value violates unique constraint «files_pkey»
CONTEXT: COPY files, line 1: «c01b78f6-1525-41b1-9cc1-69e3da58d2ac.pfl 2010-12-30 10:15:16 2012-05-16 12:42:04 0 416 \215\207\0. »
pg_restore: restoring data for table «params»
pg_restore: [archiver (db)] Error from TOC entry 13849; 0 377204 TABLE DATA params user1c
pg_restore: [archiver (db)] COPY failed: ERROR: duplicate key value violates unique constraint «params_pkey»
CONTEXT: COPY params, line 1: «locale.inf 2010-12-30 10:15:15 2010-12-30 10:15:15 0 36 \357\273\277<«ru_RU»,0,0,»»,-1,»»,»»,»»,». »
pg_restore: restoring data for table «v8users»
WARNING: errors ignored on restore: 600

Процесс вернул код выхода 1.

Это выдает при попытке «восстановить только данные » из pgAdmin в работоспособную бухгалтерию за июль

не помогло 9 постгри. Опять куча ошибок и база не открывается.
pg_restore: dropping SHELL TYPE ean13
pg_restore: dropping TYPE dblink_pkey_results
pg_restore: dropping COMMENT TYPE cube
pg_restore: dropping TYPE cube
pg_restore: dropping FUNCTION cube_out(cube)
pg_restore: [archiver (db)] Error from TOC entry 164; 1255 16855 FUNCTION cube_out(cube) postgres
pg_restore: [archiver (db)] could not execute query: ERROR: type «cube» does not exist
Command was: DROP FUNCTION public.cube_out(cube);
.
pg_restore: setting owner and privileges for INDEX byshow
WARNING: errors ignored on restore: 5395

Процесс вернул код выхода 1.

Не хочу показаться занудой, но вместо анализа дампа я бы сделал следующее:
1) Выгрузил базу в dt через конфигуратор
2) Залил базу на Postgre 9.1.2 из dt через конфигуратор
3) Сделал бы дамп в postgre 9.1.2
4) Попробовал бы залить на тот же 9.1.2 полученный дамп.

P.S. У меня для 9.1.2 дампа в командной строке есть приписочка:

-b -Z 9 -E UTF-8 — здесь указываю компрессию и кодировку

х.з. насколько это принципиально. Да — и восстанавливать я пробовал через pgAdmin 1.14.1 — хотя это тоже не принципиально — можно потом командную строку срисовать из графического интерфейса.

(22) >>Не знаю, может вам имеет смысл попробовать установить 64-битный постгри и там развернуть архив, если, канечно, есть где-то такая сборка с патчами 1С под винду.

Источник

Почему не восстанавливаются резервные копии?

Доброго дня.
Появилась проблема, и я очень прошу помощи.

Суть.
Есть сервер с CentOS 6, на базе которого крутится postgres.

Там имеются базы данных, которые используются как базы 1С.
На этом сервере есть sh скрипт который выполняется по cron. Суть этого скрипта, это бэкапить базы на NAS. Пример скрипта, приведу ниже.

И вроде всё делается нормально, бэкапы делаются, я спокоен, и пару мепсяцев один из них разворачивал, и тут попытался сделать это снова с помощью.

База изначально была создана с помощью консоли 1С.

И вот, после восстановления бэкапа я получаю следующее.

Другие бэкапы так же пытался восстановить. Количество ерроров меняется, но суть остаётся неизменной.
Я получаю следующее.

И вот полный текст.
Невосстановимая ошибка
Ошибка при выполнении запроса POST к ресурсу /e1cib/login:
по причине:
Ошибка при выполнении операции с информационной базой
Ошибка СУБД:
XX000: ERROR: There are 2 candidates for ‘mchar_pattern_fixed_prefix’ function’

по причине:
Ошибка СУБД:
XX000: ERROR: There are 2 candidates for ‘mchar_pattern_fixed_prefix’ function’

Что то мне подсказывает что это может быть типичная ошибка новичка, но я пока ума не приложу, в какую сторону копать?

PS. Я понимаю что и CentOS старый, и PGSQL. Но пока не было возможности остановить предприятие более чем на 8 часов, что бы всё перенести, а текучку никто не отменял:(

Источник

   Sergio-ps

17.09.12 — 19:09

Добрый вечер. на Win Server 2003 установлен сервер 1с, PostgreSQL.

Делаются резервные копии каждый день. Но столкнулся с проблемой. необходимо восстановить базу  на определенное число, а он при восстановлении выдает кучу ошибок на то что таблица существует, метод существует и тд , невозможно перезаписать. и в итоге Процесс вернул код выхода 1.

Соответсвенно в пустую базу он ничего не восстанавливает, она остается пустой. пробовал как создавать новую базу из управления серверами 1с, так и средствами postgres.

   Sergio-ps

1 — 17.09.12 — 19:12

бэкап делается по команде

«C:Program Files (x86)PostgreSQL8.4.3-3.1Cbinpg_dump.exe» -i -h localhost -p 5432 -U postgres -Fc -b -f «F:postgres_backup%datetemp%.backup» Base

Восстанавливать пробовал из PgAdmin  и командой

«C:Program Files (x86)PostgreSQL8.4.3-3.1Cbinpg_restore.exe» -i -h localhost -U postgres -c -d BuhTemp «F:postgres_backupBUHBUH_120803.backup»

   глазковыколупыватель

2 — 17.09.12 — 19:37

Base сначала очистить надо. Или удалить, а потом — опять создать.

   Ben_art

3 — 17.09.12 — 19:39

схему дропни или только таблицы

   Sergio-ps

4 — 17.09.12 — 20:32

Я пустую базу создаю и в нее пытаюсь восстанавливать, наверно не имеет значения что у нее имя другое?

   ansh15

5 — 17.09.12 — 21:51

(4) Не имеет.

Попробуйте без флага -с в созданную пустую базу. Сейчас проверял, с флагом -с (-c —clean Clean (drop) database objects before recreating them) выдает ошибки, без него нормально восстанавливает.

   Sergio-ps

6 — 17.09.12 — 22:09

хорошо попробую.

Вот создал новую базу и в нее восстановил с помощью pgAdmin/ он по умолчанию сделал такой командой:

C:Program Files (x86)PostgreSQL8.4.3-3.1Cbinpg_restore.exe -i -h localhost -p 5432 -U postgres -d «BuhTemp» -v «F:postgres_backupBUH_120725.backup»

В итоге куча ошибок. и база не восстановлена, даже конфигуратор не открывается.

…..

pg_restore: connecting to database for restore

pg_restore: creating SCHEMA public

pg_restore: creating COMMENT SCHEMA public

pg_restore: creating PROCEDURAL LANGUAGE plpgsql

pg_restore: [archiver (db)] Error while PROCESSING TOC:

pg_restore: [archiver (db)] Error from TOC entry 5256; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres

pg_restore: [archiver (db)] could not execute query: ERROR:  language «plpgsql» already exists

Command was:

CREATE PROCEDURAL LANGUAGE plpgsql;

pg_restore: creating SHELL TYPE chkpass

pg_restore: [archiver (db)] Error from TOC entry 1230; 0 0 SHELL TYPE chkpass postgres

pg_restore: [archiver (db)] could not execute query: ERROR:  type «chkpass» already exists

……..

pg_restore: creating FUNCTION isnge(ean13, upc)

pg_restore: [archiver (db)] Error from TOC entry 391; 1255 17237 FUNCTION isnge(ean13, upc) postgres

pg_restore: [archiver (db)] could not execute query: ERROR:  function «isnge» already exists with same argument types

   Command was: CREATE FUNCTION isnge(ean13, upc) RETURNS boolean

   LANGUAGE internal IMMUTABLE STRICT

   AS $$int8ge$$;

……

pg_restore: setting owner and privileges for INDEX byosname

pg_restore: setting owner and privileges for INDEX byrolesid

pg_restore: setting owner and privileges for INDEX byshow

WARNING: errors ignored on restore: 6866

Процесс вернул код выхода 1.

   ansh15

7 — 17.09.12 — 22:54

А базу чем создаете? Из консоли администрирования 1С? Или в PgAdmin?

   Sergio-ps

8 — 17.09.12 — 23:26

уже и тем и другим способом пробовал. Все равно не восстанавливает. причем пробовал уже и другой архив брать, тоже самое. может не правильная команда создания копии?

   ansh15

9 — 18.09.12 — 10:17

Посомтри содержимое архива, вдруг он текстовый, блокнотом каким-нибудь.

Архив, созданный с флагом «-F c» начинается со слова PGDUMP, текстовый начинается со строк



— PostgreSQL database dump



и дальше команды SQL. Можно попробовать явно задать custom формат в pg_restore «-F c». Кстати, у тебя в командной строке «-Fc», без пробела, может в Windows как-то влияет, в Linux без разницы.

   Sergio-ps

10 — 18.09.12 — 11:54

Хорошо, попытаюсь посмотреть, уже 5 минут WordPad открывает.

Кстати, не могли бы выложить рабочую комбинацию команд архивации и восстановления. на будущее хотя бы поменять. потому как походу ни один архив не восстанавливается.

   Sergio-ps

11 — 18.09.12 — 12:29

архив начинается с

PGDMP

потмо название базы, кодировка и наверное команды. правда все так висит, что даже скопировать оттуда не удается.

Кстакти вот например строка

2200 — public — SCHEMA  T CREATE SCHEMA public;

?I DROP SCHEMA public;

o postgres | false

странно как то, получается он сначала создает а потом удаляет?

   Sergio-ps

12 — 18.09.12 — 12:36

и интересно что значит строчка

postgres | false? там много таких, или User1c | false. что то с пользователями связано

   ansh15

13 — 18.09.12 — 12:36

Базу рукам попробуй создать, в командной строке на сервере. creаtedb.exe -U postgres testbuh1, например.

Потом pg_restore.exe -U postgres -d testbuh1 имя_архива.

   Sergio-ps

14 — 18.09.12 — 13:55

создал пустую базу, почему то опять ругается на существующие элементы. и в самом конце вот что выдал:

pg_restore: [archiver (db)] COPY failed: ERROR:  out of memory

DETAIL:  Failed on request of size 536870912.

CONTEXT:  COPY config, line 9419: «e0666db2-45d6-49b4-a200-061c6ba7

-8696-411f-95a1-ef011fdf8da9    2012-03-28 16:49:37     2012-0…»

WARNING: errors ignored on restore: 1130

В итоге база не запускается. конфигуратор открывается но видит пустую конфигурацию

   Sergio-ps

15 — 18.09.12 — 14:06

если только попробовать загрузить сначала в базу дтшник старый, а потом попробовать через постгрес восстановить только данные?

   BigHarry

16 — 18.09.12 — 15:20

«COPY failed: ERROR:  out of memory» — проходили, вылечили только загрузкой дампа в постгри, установленный на линуксе, на виндовый постгря дамп упорно не хотел заливаться, вылезала «out of memory»,  никакие манипуляции с конфигом не помогали.

   BigHarry

17 — 18.09.12 — 15:22

А корень зла — бинарники, хранимые в БД, большие фотографии или pdf-ки…

   Sergio-ps

18 — 18.09.12 — 15:56

Бухгалтерия предприятия. вроде нет файлов. если только документы.

   Sergio-ps

19 — 18.09.12 — 15:58

а на виртуалке если поднять постгри, думаете поможет?

   Sergio-ps

20 — 18.09.12 — 16:21

pg_restore: [archiver (db)] Error from TOC entry 13847; 0 361139 TABLE DATA config user1c

pg_restore: [archiver (db)] COPY failed: ERROR:  duplicate key value violates unique constraint «config_pkey»

CONTEXT:  COPY config, line 1: «d4a1f489-2fba-41f6-ab57-3986f22c7403    2012-03-28 16:50:37    2012-03-28 16:50:37    0    89    {\277{\177\265…»

pg_restore: restoring data for table «configsave»

pg_restore: restoring data for table «dbschema»

pg_restore: restoring data for table «files»

pg_restore: [archiver (db)] Error from TOC entry 13850; 0 377251 TABLE DATA files user1c

pg_restore: [archiver (db)] COPY failed: ERROR:  duplicate key value violates unique constraint «files_pkey»

CONTEXT:  COPY files, line 1: «c01b78f6-1525-41b1-9cc1-69e3da58d2ac.pfl    2010-12-30 10:15:16    2012-05-16 12:42:04    0    416    \215\207\0…»

pg_restore: restoring data for table «params»

pg_restore: [archiver (db)] Error from TOC entry 13849; 0 377204 TABLE DATA params user1c

pg_restore: [archiver (db)] COPY failed: ERROR:  duplicate key value violates unique constraint «params_pkey»

CONTEXT:  COPY params, line 1: «locale.inf    2010-12-30 10:15:15    2010-12-30 10:15:15    0    36    \357\273\277{«ru_RU»,0,0,»»,-1,»»,»»,»»,»…»

pg_restore: restoring data for table «v8users»

WARNING: errors ignored on restore: 600

Процесс вернул код выхода 1.

Это выдает при попытке «восстановить только данные » из pgAdmin в работоспособную бухгалтерию за июль

   Sergio-ps

21 — 18.09.12 — 16:21

и соответственно новых данных не появляется

   BigHarry

22 — 18.09.12 — 16:30

(19) Я на виртуалке не стал развертывать, ибо винда и железо было только 32 разрядное, просто на какой-то ближайшей рабочей станции установил линукс и слона.

Не знаю, может вам имеет смысл попробовать установить 64-битный постгри и там развернуть архив, если, канечно, есть где-то такая сборка с патчами 1С под винду…

   alxbzm

23 — 18.09.12 — 16:46

Я бы посоветовал взять 9-й постгри и попробовать на нем (в том числе и утилиты pg_dump / pg_restore соответствующих версий)… Я тут неоднократно писал про чудеса 8.4.x. У меня сейчас крутится 9.1.2 от 1С — вроде полет нормальный — и с бэкапом, и с восстановлением.

   Sergio-ps

24 — 18.09.12 — 17:41

поставил 9,1,2 постгри, пытаюсь туда восстановить. посмотрим

   Sergio-ps

25 — 18.09.12 — 18:41

не помогло 9 постгри. Опять куча ошибок и база не открывается.

pg_restore: dropping SHELL TYPE ean13

pg_restore: dropping TYPE dblink_pkey_results

pg_restore: dropping COMMENT TYPE cube

pg_restore: dropping TYPE cube

pg_restore: dropping FUNCTION cube_out(cube)

pg_restore: [archiver (db)] Error from TOC entry 164; 1255 16855 FUNCTION cube_out(cube) postgres

pg_restore: [archiver (db)] could not execute query: ERROR:  type «cube» does not exist

   Command was: DROP FUNCTION public.cube_out(cube);



pg_restore: setting owner and privileges for INDEX byshow

WARNING: errors ignored on restore: 5395

Процесс вернул код выхода 1.

   BigHarry

26 — 18.09.12 — 19:33

Сильно большой у вас дамп?

   глазковыколупыватель

27 — 18.09.12 — 20:15

+ (26) Давай дамп, выкладывай куда-нить.

   alxbzm

28 — 18.09.12 — 22:27

Не хочу показаться занудой, но вместо анализа дампа я бы сделал следующее:

1) Выгрузил базу в dt через конфигуратор

2) Залил базу на Postgre 9.1.2 из dt через конфигуратор

3) Сделал бы дамп в postgre 9.1.2

4) Попробовал бы залить на тот же 9.1.2 полученный дамп.

P.S. У меня для 9.1.2 дампа в командной строке есть приписочка:

-b -Z 9 -E UTF-8 — здесь указываю компрессию и кодировку

х.з. насколько это принципиально. Да — и восстанавливать я пробовал через pgAdmin 1.14.1 — хотя это тоже не принципиально — можно потом командную строку срисовать из графического интерфейса.

   ansh15

29 — 18.09.12 — 23:05

(22) >>Не знаю, может вам имеет смысл попробовать установить 64-битный постгри и там развернуть архив, если, канечно, есть где-то такая сборка с патчами 1С под винду…

Есть. На пользовательском сайте 1С.

   Sergio-ps

30 — 19.09.12 — 01:16

Выгрузить базу в dt я конечно могу, но бухгалтерам вот приспичило восстановить от 1го августа. че то они там удалили потом нечаянно. поэтому и мучаюсь с этим дампом, т.к. нету других копий за те числа.

64 юитный постгри.. попробую.

Кстати заметил, когда восстанавливаю в базу созданную через пгАдмин или Средствами 1с, то вылазиют ошибки про существующие таблицы и тд., а когда создаю базу сreаtedb.exe -U postgres названиебазы, и восстанавливаю  pg_restore.exe -U postgres -d названиебазы имя_архива, то потом вываливается out of memory

   Sergio-ps

31 — 19.09.12 — 01:18

дамп размером 600 метров, размер азы в папке постгри 7 гигов.

   zzhiraf

32 — 19.09.12 — 09:55

(29) А можно ссылочку? И еще вопрос как перенести данные с MS SQL?

   ansh15

33 — 19.09.12 — 10:38

(32) Пожалуйста. http://users.v8.1c.ru/version.jsp?id=AddCompPostgre&ver=9.1.2-1.1C

Если есть доступ, конечно.

Перенос тоже просто, через dt файл.

   ansh15

34 — 19.09.12 — 10:49

(30) Когда база создается через консоль администрирования, в ней создаются таблицы, типы данных и т.д.

Поэтому при восстановлении и появляются ошибки о существующих таблицах.

Попробуй PostgreSQL x64, может поможет с out of memory.

   ansh15

35 — 19.09.12 — 10:51

   ansh15

36 — 19.09.12 — 11:03

(30) http://www.sql.ru/forum/actualthread.aspx?tid=594580

Пишут, что можно поварьировать maintenance_work_mem.

   zzhiraf

37 — 19.09.12 — 11:55

(33) Спасибо. Нет доступа(

   Sergio-ps

38 — 19.09.12 — 12:47

maintenance_work_mem стоит по умолчанию. Текущее значение 16384. наверно в мегабайтах. хотя оперативки всего 8 гигов. попробую поменять на меньшее значение)

докачаю — выложу куда нибудь сборку постгреса

   Sergio-ps

39 — 19.09.12 — 13:03

   Sergio-ps

40 — 19.09.12 — 13:06

   zzhiraf

41 — 19.09.12 — 13:14

(40) Спасибо!

   ansh15

42 — 19.09.12 — 13:45

   zzhiraf

43 — 19.09.12 — 14:09

(42) а постгрес еще надо настраивать? есть ли готовые файлы с оптимальными настройками?)

   ansh15

44 — 19.09.12 — 14:29

(43) В зависимости от ваших конфигураций, размера баз и объема памяти сервера.

Поищите по форуму, были темы по настройке postgresql.conf.

В Интернете тоже много найдется. На сайте Гилева, например.

   zzhiraf

45 — 19.09.12 — 14:37

(44) Нашел сайт Гилева, почитаю, спасибо.

   ansh15

46 — 19.09.12 — 14:51

   zzhiraf

47 — 19.09.12 — 15:43

(46) ага, спасибо!

   Sergio-ps

48 — 19.09.12 — 16:25

в продолжение темы про восстановление, на том же сервере есть еще одна база гига на 2 поменьше, бэкапится теми же командами, при восстановлении так же куча ошибок про существующие объекты, возвращает код 1, но в итоге после восстановления она работает.

Пока убедил бухгалтеров что нету копии за август, но найду свободный комп и попробую поднять постгрес на линуксе

  

DGorgoN

49 — 19.09.12 — 16:33

(48) Виртуалку поставь

>pg_restore -d postgres users-2015-09-30.tar Password: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 189; 1259 20404 TABLE users regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «users» already exists Command was: CREATE TABLE users ( id integer NOT NULL, user_id character varying NOT NULL, google_refresh_token character var… pg_restore: [archiver (db)] Error from TOC entry 190; 1259 20411 SEQUENCE users_id_seq regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «users_id_seq» already exists Command was: CREATE SEQUENCE users_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; pg_restore: [archiver (db)] Error from TOC entry 3184; 2606 20439 CONSTRAINT users_pkey regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table «users» are not allowed Command was: ALTER TABLE ONLY users ADD CONSTRAINT users_pkey PRIMARY KEY (id); pg_restore: [archiver (db)] Error from TOC entry 3186; 2606 20441 CONSTRAINT users_user_id_key regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «users_user_id_key» already exists Command was: ALTER TABLE ONLY users ADD CONSTRAINT users_user_id_key UNIQUE (user_id); pg_restore: [archiver (db)] Error from TOC entry 3182; 1259 20447 INDEX idx_users_user_id regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «idx_users_user_id» already exists Command was: CREATE INDEX idx_users_user_id ON users USING btree (user_id); WARNING: errors ignored on restore: 5 E:codingaaltoDBDumps>pg_restore -d postgres devices-2015-09-30.tar Password: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 187; 1259 20387 TABLE devices regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «devices» already exists Command was: CREATE TABLE devices ( id integer NOT NULL, token uuid NOT NULL, created timestamp without time zone DEFAULT now… pg_restore: [archiver (db)] Error from TOC entry 188; 1259 20393 SEQUENCE devices_id_seq regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «devices_id_seq» already exists Command was: CREATE SEQUENCE devices_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; >pg_restore -d postgres devices-2015-09-30.tar pg_restore: [archiver (db)] Error from TOC entry 3309; 0 20387 TABLE DATA devices regularroutes pg_restore: [archiver (db)] COPY failed for table «devices»: ERROR: permission denied for schema public LINE 1: SELECT 1 FROM ONLY «public».»users» x WHERE «id» OPERATOR(pg… ^ QUERY: SELECT 1 FROM ONLY «public».»users» x WHERE «id» OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x pg_restore: [archiver (db)] Error from TOC entry 3185; 2606 20431 CONSTRAINT devices_pkey regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table «devices» are not allowed Command was: ALTER TABLE ONLY devices ADD CONSTRAINT devices_pkey PRIMARY KEY (id); pg_restore: [archiver (db)] Error from TOC entry 3187; 2606 20433 CONSTRAINT devices_token_key regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «devices_token_key» already exists Command was: ALTER TABLE ONLY devices ADD CONSTRAINT devices_token_key UNIQUE (token); pg_restore: [archiver (db)] Error from TOC entry 3189; 2606 20435 CONSTRAINT uix_device_id_installation_id regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «uix_device_id_installation_id» already exists Command was: ALTER TABLE ONLY devices ADD CONSTRAINT uix_device_id_installation_id UNIQUE (device_id, installation_id); pg_restore: [archiver (db)] Error from TOC entry 3191; 2606 20437 CONSTRAINT uix_token regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «uix_token» already exists Command was: ALTER TABLE ONLY devices ADD CONSTRAINT uix_token UNIQUE (token); pg_restore: [archiver (db)] Error from TOC entry 3192; 2606 20470 FK CONSTRAINT fk_user_id regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: constraint «fk_user_id» for relation «devices» already exists Command was: ALTER TABLE ONLY devices ADD CONSTRAINT fk_user_id FOREIGN KEY (user_id) REFERENCES users(id) MATCH FULL; >pg_restore -d postgres device_data-2015-09-16.tar Password: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 185; 1259 20379 TABLE device_data regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «device_data» already exists Command was: CREATE TABLE device_data ( id integer NOT NULL, device_id integer NOT NULL, coordinate geography(Point,4326) NOT… pg_restore: [archiver (db)] Error from TOC entry 186; 1259 20385 SEQUENCE device_data_id_seq regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «device_data_id_seq» already exists Command was: CREATE SEQUENCE device_data_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; pg_restore: [archiver (db)] Error from TOC entry 3295; 0 20379 TABLE DATA device_data regularroutes pg_restore: [archiver (db)] COPY failed for table «device_data»: ERROR: permission denied for schema public LINE 1: SELECT 1 FROM ONLY «public».»devices» x WHERE «id» OPERATOR(… ^ QUERY: SELECT 1 FROM ONLY «public».»devices» x WHERE «id» OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x pg_restore: [archiver (db)] Error from TOC entry 3174; 2606 20429 CONSTRAINT device_data_pkey regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: multiple primary keys for table «device_data» are not allowed Command was: ALTER TABLE ONLY device_data ADD CONSTRAINT device_data_pkey PRIMARY KEY (id); pg_restore: [archiver (db)] Error from TOC entry 3175; 1259 20444 INDEX idx_device_data_device_id_time regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «idx_device_data_device_id_time» already exists Command was: CREATE INDEX idx_device_data_device_id_time ON device_data USING btree (device_id, «time»); pg_restore: [archiver (db)] Error from TOC entry 3176; 1259 20445 INDEX idx_device_data_snapping_time_null regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «idx_device_data_snapping_time_null» already exists Command was: CREATE INDEX idx_device_data_snapping_time_null ON device_data USING btree (snapping_time) WHERE (snapping_time IS NULL); pg_restore: [archiver (db)] Error from TOC entry 3177; 1259 20446 INDEX idx_device_data_time regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: relation «idx_device_data_time» already exists Command was: CREATE INDEX idx_device_data_time ON device_data USING btree («time»); pg_restore: [archiver (db)] Error from TOC entry 3178; 2606 20465 FK CONSTRAINT device_data_device_id_fkey regularroutes pg_restore: [archiver (db)] could not execute query: ERROR: constraint «device_data_device_id_fkey» for relation «device_data» already exists Command was: ALTER TABLE ONLY device_data ADD CONSTRAINT device_data_device_id_fkey FOREIGN KEY (device_id) REFERENCES devices(id);


Форум программистов Vingrad

Модераторы: LSD

Поиск:

Ответ в темуСоздание новой темы
Создание опроса
> PostgreSQL 8.2 восстановление backup с ошибкой 

V

   

Опции темы

Иван Человеков
  Дата 7.2.2007, 13:12 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Бывалый
*

Профиль
Группа: Участник
Сообщений: 235
Регистрация: 11.3.2006
Где: Минск

Репутация: нет
Всего: 1

СУБД PostgreSQL 8.2 cделал утилитой pgAdmin III версия 1.6.2 backup, когда я его пытаюсь восстановить, восстановление идёт с ошибкой:

Код

C:Program FilespgAdmin III1.6pg_restore.exe -i -h localhost -p 5432 -U postgres -d zpldatabase -v "D:Java_ToolsIDEIdeaProjectszplbackupzpldatabase.backup"
pg_restore: connecting to database for restore
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 270; 2612 16386 PROCEDURAL LANGUAGE plpgsql postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  language "plpgsql" already exists
    Command was: CREATE PROCEDURAL LANGUAGE plpgsql;
pg_restore: creating TABLE config
pg_restore: [archiver (db)] Error from TOC entry 1281; 1259 16571 TABLE config postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "config" already exists
    Command was: CREATE TABLE config (
    id integer NOT NULL,
    name_firm character varying(45),
    stavka_razrada money,
    fio_direct...
pg_restore: creating SEQUENCE config_id_seq
pg_restore: [archiver (db)] Error from TOC entry 1280; 1259 16569 SEQUENCE config_id_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "config_id_seq" already exists
    Command was: CREATE SEQUENCE config_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
pg_restore: creating SEQUENCE OWNED BY config_id_seq
pg_restore: executing SEQUENCE SET config_id_seq
pg_restore: creating TABLE month
pg_restore: [archiver (db)] Error from TOC entry 1277; 1259 16552 TABLE month postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "month" already exists
    Command was: CREATE TABLE "month" (
    id numeric NOT NULL,
    dat date
);
pg_restore: creating TABLE person
pg_restore: [archiver (db)] Error from TOC entry 1275; 1259 16545 TABLE person postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "person" already exists
    Command was: CREATE TABLE person (
    id integer NOT NULL,
    fio character varying(45),
    doljnost character varying(17),
    koef_t...
pg_restore: creating SEQUENCE person_id_seq
pg_restore: [archiver (db)] Error from TOC entry 1276; 1259 16547 SEQUENCE person_id_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "person_id_seq" already exists
    Command was: CREATE SEQUENCE person_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
pg_restore: creating SEQUENCE OWNED BY person_id_seq
pg_restore: executing SEQUENCE SET person_id_seq
pg_restore: creating TABLE zarpl
pg_restore: [archiver (db)] Error from TOC entry 1279; 1259 16561 TABLE zarpl postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "zarpl" already exists
    Command was: CREATE TABLE zarpl (
    id integer NOT NULL,
    id_person integer,
    id_month integer,
    kol_day smallint,
    razrad ...
pg_restore: creating SEQUENCE zarpl_id_seq
pg_restore: [archiver (db)] Error from TOC entry 1278; 1259 16559 SEQUENCE zarpl_id_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "zarpl_id_seq" already exists
    Command was: CREATE SEQUENCE zarpl_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
pg_restore: creating SEQUENCE OWNED BY zarpl_id_seq
pg_restore: executing SEQUENCE SET zarpl_id_seq
pg_restore: creating DEFAULT id
pg_restore: creating DEFAULT id
pg_restore: creating DEFAULT id
pg_restore: restoring data for table "config"
pg_restore: restoring data for table "month"
pg_restore: restoring data for table "person"
pg_restore: restoring data for table "zarpl"
pg_restore: [archiver (db)] Error from TOC entry 1625; 0 16561 TABLE DATA zarpl postgres
pg_restore: [archiver (db)] COPY failed: ERROR:  duplicate key violates unique constraint "zarpl_pkey"
CONTEXT:  COPY zarpl, line 1: "1    N    N    N    N    N    N    N    N    N    N    N    N    N    N"
pg_restore: creating CONSTRAINT config_pkey
pg_restore: [archiver (db)] Error from TOC entry 1622; 2606 16575 CONSTRAINT config_pkey postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  multiple primary keys for table "config" are not allowed
    Command was: ALTER TABLE ONLY config
    ADD CONSTRAINT config_pkey PRIMARY KEY (id);
pg_restore: creating CONSTRAINT month_pkey
pg_restore: [archiver (db)] Error from TOC entry 1618; 2606 16558 CONSTRAINT month_pkey postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  multiple primary keys for table "month" are not allowed
    Command was: ALTER TABLE ONLY "month"
    ADD CONSTRAINT month_pkey PRIMARY KEY (id);
pg_restore: creating CONSTRAINT person_pkey
pg_restore: [archiver (db)] Error from TOC entry 1616; 2606 16551 CONSTRAINT person_pkey postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  multiple primary keys for table "person" are not allowed
    Command was: ALTER TABLE ONLY person
    ADD CONSTRAINT person_pkey PRIMARY KEY (id);
pg_restore: creating CONSTRAINT zarpl_pkey
pg_restore: [archiver (db)] Error from TOC entry 1620; 2606 16568 CONSTRAINT zarpl_pkey postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  multiple primary keys for table "zarpl" are not allowed
    Command was: ALTER TABLE ONLY zarpl
    ADD CONSTRAINT zarpl_pkey PRIMARY KEY (id);
pg_restore: setting owner and privileges for SCHEMA public
pg_restore: setting owner and privileges for COMMENT SCHEMA public
pg_restore: setting owner and privileges for ACL public
pg_restore: setting owner and privileges for PROCEDURAL LANGUAGE plpgsql
pg_restore: setting owner and privileges for TABLE config
pg_restore: setting owner and privileges for SEQUENCE config_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY config_id_seq
pg_restore: setting owner and privileges for TABLE month
pg_restore: setting owner and privileges for TABLE person
pg_restore: setting owner and privileges for SEQUENCE person_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY person_id_seq
pg_restore: setting owner and privileges for TABLE zarpl
pg_restore: setting owner and privileges for SEQUENCE zarpl_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY zarpl_id_seq
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for CONSTRAINT config_pkey
pg_restore: setting owner and privileges for CONSTRAINT month_pkey
pg_restore: setting owner and privileges for CONSTRAINT person_pkey
pg_restore: setting owner and privileges for CONSTRAINT zarpl_pkey
WARNING: errors ignored on restore: 13

Process returned exit code 1.

Подскажите, в чём может быть проблема? 
Как Вы делаете бэкап? Может есть альтернативный способ? smile
Спасибо smile

PM ICQ   Вверх
tux
Дата 7.2.2007, 13:59 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Летатель
***

Профиль
Группа: Участник Клуба
Сообщений: 1853
Регистрация: 10.2.2005
Где: msk.ru

Репутация: 2
Всего: 132

Цитата(Иван Человеков @  7.2.2007,  13:12 Найти цитируемый пост)
Подскажите, в чём может быть проблема? 

Проблема в том, что в базе объекты (таблицы и т.п.) уже существуют, а ты из скрипта пытаешься создать их заново. 

Чтобы создать скрипт, который будет удалять объекты прежде чем создавать, можно выполнить следующее:

Цитата
pg_dump -c -t dump.sql db

Здесь dump.sql — файл дампа, а db — имя базы данных.

PM MAIL Skype GTalk Jabber YIM   Вверх
Иван Человеков
  Дата 8.2.2007, 08:37 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Бывалый
*

Профиль
Группа: Участник
Сообщений: 235
Регистрация: 11.3.2006
Где: Минск

Репутация: нет
Всего: 1

tux,  как я понял бэкапы делать лучше самому руками smile
Получилось у меня так сделать бэкап:

Код

pg_dump -u -c zpldatabase > d:db.sql

Как теперь его восстановить? Получается надо использовать утилиту psql, потому как дамп текстовый(pg_restore — подходит для архивов). Я верно понимаю? smile 
Пробовал так:

Код

psql "d:db.sql" template1

в книге есть так:

Код

psql -U manager -f booktown.sql templatel 

Но не получается, как только я не пробовал smile 
Покажи пожалуйста как ты обычно делаешь бэкапы с заменой всего данных и структуры таблицы smile
Спасибо за помощь smile

PM ICQ   Вверх
tux
Дата 8.2.2007, 09:00 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Летатель
***

Профиль
Группа: Участник Клуба
Сообщений: 1853
Регистрация: 10.2.2005
Где: msk.ru

Репутация: 2
Всего: 132

Цитата(Иван Человеков @  8.2.2007,  08:37 Найти цитируемый пост)
Покажи пожалуйста как ты обычно делаешь бэкапы с заменой всего данных и структуры таблицы smile

Уже никак не делаю. Но делал именно так. У PostgreSQL инкрементного бэкапа нет, приходится вот таким образом. Так вот выполняешь что не получается?

Цитата
psql -U manager -f booktown.sql templatel 

Почему у тебя база template1? Она системная — шаблон для создания новых баз данных.

PM MAIL Skype GTalk Jabber YIM   Вверх
Иван Человеков
Дата 8.2.2007, 09:23 (ссылка)
| (нет голосов)
Загрузка ... Загрузка …




Быстрая цитата

Цитата

Бывалый
*

Профиль
Группа: Участник
Сообщений: 235
Регистрация: 11.3.2006
Где: Минск

Репутация: нет
Всего: 1

Сделал так:

Код

psql -U zpldatabase < "d:db.sql"

и получилось smile Спасибо tux.

PM ICQ   Вверх



















Ответ в темуСоздание новой темы
Создание опроса
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | PostgreSQL | Следующая тема »

Понравилась статья? Поделить с друзьями:
  • Error from the deep
  • Error from server wrong credentials or no license перевод
  • Error from server too much usages перевод
  • Error from server notfound replicationcontrollers kubia not found
  • Error from server notfound pods not found