Restore from Backup

Forum with tips, support, etc, on using the PostgreSQL database with Poker Tracker. Please post any PostgreSQL questions here.

Re: Restore from Backup

Postby dbot2006 » Sat Mar 28, 2009 3:32 am

We have a winner! I am restored. Thank you.
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby AceInRed » Sun May 17, 2009 5:13 pm

dbot2006 wrote:We have a winner! I am restored. Thank you.


Hi,

I have the same problem and followed the instructions. This is the error mesg I got.

Bernhard

C:\Program Files\PostgreSQL\8.3\bin\pg_restore.exe -h localhost -p 5432 -U postgres -d "ACEINRED2008" -v "G:\Poker\AceInRed2008 BU.backup"
C:\Program Files\PostgreSQL\8.3\bin\pg_restore.exe -h localhost -p 5432 -U postgres -d "ACEINRED2008" "G:\Poker\AceInRed2008 BU.backup"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 301; 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: [archiver (db)] Error from TOC entry 1307; 1259 18290 TABLE blind_structure postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "blind_structure" already exists
Command was: CREATE TABLE blind_structure (
blind_structure_id smallint,
blind_structure_desc text,
big_bet integer
);
pg_restore: [archiver (db)] Error from TOC entry 1325; 1259 18368 TABLE datawindow_prefs postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "datawindow_prefs" already exists
Command was: CREATE TABLE datawindow_prefs (
window text,
datawindow text,
pref_key text,
custom_id integer,
custom_n...
pg_restore: [archiver (db)] Error from TOC entry 1308; 1259 18295 TABLE dst postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "dst" already exists
Command was: CREATE TABLE dst (
date_from timestamp with time zone,
date_to timestamp with time zone,
dst_value smallint
);
pg_restore: [archiver (db)] Error from TOC entry 1324; 1259 18363 TABLE error_msgs postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "error_msgs" already exists
Command was: CREATE TABLE error_msgs (
date_written timestamp without time zone,
file_name text,
error_msg text,
came_fro...
pg_restore: [archiver (db)] Error from TOC entry 1309; 1259 18297 TABLE exrates postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "exrates" already exists
Command was: CREATE TABLE exrates (
exdate timestamp with time zone,
usd real,
gbp real,
euro real
);
pg_restore: [archiver (db)] Error from TOC entry 1316; 1259 18329 TABLE game postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "game" already exists
Command was: CREATE TABLE game (
game_id integer,
game_number integer,
site_id smallint,
date_played timestamp with time ...
pg_restore: [archiver (db)] Error from TOC entry 1314; 1259 18319 TABLE game_level postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "game_level" already exists
Command was: CREATE TABLE game_level (
game_level_id smallint,
game_level_desc text,
game_level_big_bet real,
pl_nl small...
pg_restore: [archiver (db)] Error from TOC entry 1317; 1259 18334 TABLE game_players postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "game_players" already exists
Command was: CREATE TABLE game_players (
game_id integer,
player_id integer,
seat_number smallint,
button smallint,
h...
pg_restore: [archiver (db)] Error from TOC entry 1315; 1259 18324 TABLE hand_histories postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "hand_histories" already exists
Command was: CREATE TABLE hand_histories (
game_number integer,
site_id smallint,
hand_history text,
import_date timestam...
pg_restore: [archiver (db)] Error from TOC entry 1310; 1259 18299 TABLE hand_rank postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "hand_rank" already exists
Command was: CREATE TABLE hand_rank (
hand_rank_id smallint,
hand_rank_desc text
);
pg_restore: [archiver (db)] Error from TOC entry 1319; 1259 18344 TABLE player_winnings postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "player_winnings" already exists
Command was: CREATE TABLE player_winnings (
date_played timestamp with time zone,
game_level_id smallint,
site_id smallint,
...
pg_restore: [archiver (db)] Error from TOC entry 1311; 1259 18304 TABLE players postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "players" already exists
Command was: CREATE TABLE players (
player_id integer,
screen_name text,
"location" text,
general_description text,
t...
pg_restore: [archiver (db)] Error from TOC entry 1312; 1259 18309 TABLE poker_sites postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "poker_sites" already exists
Command was: CREATE TABLE poker_sites (
site_id smallint,
site_abbrev character varying(3),
site_name text
);
pg_restore: [archiver (db)] Error from TOC entry 1313; 1259 18314 TABLE prefs postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "prefs" already exists
Command was: CREATE TABLE prefs (
pref_key character varying(20),
pref_value character varying(50),
long_pref text
);
pg_restore: [archiver (db)] Error from TOC entry 1318; 1259 18339 TABLE session postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "session" already exists
Command was: CREATE TABLE "session" (
session_id integer,
player_id integer,
session_start timestamp with time zone,
sess...
pg_restore: [archiver (db)] Error from TOC entry 1320; 1259 18346 TABLE tourney postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney" already exists
Command was: CREATE TABLE tourney (
tourney_id integer,
site_id smallint,
tourney_number integer,
tourney_start timestamp...
pg_restore: [archiver (db)] Error from TOC entry 1326; 1259 18373 TABLE tourney_desc postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney_desc" already exists
Command was: CREATE TABLE tourney_desc (
tdesc_id integer,
tdesc text,
ttype_id integer
);
pg_restore: [archiver (db)] Error from TOC entry 1321; 1259 18351 TABLE tourney_game postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney_game" already exists
Command was: CREATE TABLE tourney_game (
tourney_id integer,
game_id integer,
game_number integer,
date_played timestamp ...
pg_restore: [archiver (db)] Error from TOC entry 1322; 1259 18356 TABLE tourney_game_players postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney_game_players" already exists
Command was: CREATE TABLE tourney_game_players (
tourney_id integer,
game_id integer,
player_id integer,
seat_number smal...
pg_restore: [archiver (db)] Error from TOC entry 1323; 1259 18361 TABLE tourney_summary postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney_summary" already exists
Command was: CREATE TABLE tourney_summary (
tourney_id integer,
place_of_finish smallint,
player_id integer,
amt_won real...
pg_restore: [archiver (db)] Error from TOC entry 1327; 1259 18378 TABLE tourney_type postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "tourney_type" already exists
Command was: CREATE TABLE tourney_type (
ttype_id integer,
ttype_desc text
);
pg_restore: [archiver (db)] Error from TOC entry 1306; 1259 18285 TABLE version_info postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "version_info" already exists
Command was: CREATE TABLE version_info (
db_version text
);
pg_restore: [archiver (db)] Error from TOC entry 1659; 2606 19096 CONSTRAINT blind_structure_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "blind_structure_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY blind_structure
ADD CONSTRAINT blind_structure_idx_01 UNIQUE (blind_structure_id);
pg_restore: [archiver (db)] Error from TOC entry 1661; 2606 19098 CONSTRAINT blind_structure_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "blind_structure_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY blind_structure
ADD CONSTRAINT blind_structure_idx_02 UNIQUE (blind_structure_desc);
pg_restore: [archiver (db)] Error from TOC entry 1729; 2606 19167 CONSTRAINT datawindow_prefs_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "datawindow_prefs_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY datawindow_prefs
ADD CONSTRAINT datawindow_prefs_idx_01 UNIQUE (window, datawindow, pref_key, custom_id);
pg_restore: [archiver (db)] Error from TOC entry 1663; 2606 19100 CONSTRAINT exrates_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: relation "exrates_idx_01" already exists
Command was: ALTER TABLE ONLY exrates
ADD CONSTRAINT exrates_idx_01 UNIQUE (exdate);
pg_restore: [archiver (db)] Error from TOC entry 1684; 2606 19119 CONSTRAINT game_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game
ADD CONSTRAINT game_idx_01 UNIQUE (game_id);
pg_restore: [archiver (db)] Error from TOC entry 1686; 2606 19121 CONSTRAINT game_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game
ADD CONSTRAINT game_idx_02 UNIQUE (game_number, site_id);
pg_restore: [archiver (db)] Error from TOC entry 1688; 2606 19123 CONSTRAINT game_idx_03b postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_idx_03b"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game
ADD CONSTRAINT game_idx_03b UNIQUE (ub_game_number, site_id);
pg_restore: [archiver (db)] Error from TOC entry 1678; 2606 19102 CONSTRAINT game_level_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_level_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game_level
ADD CONSTRAINT game_level_idx_01 UNIQUE (game_level_id);
pg_restore: [archiver (db)] Error from TOC entry 1680; 2606 19104 CONSTRAINT game_level_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_level_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game_level
ADD CONSTRAINT game_level_idx_02 UNIQUE (game_level_desc);
pg_restore: [archiver (db)] Error from TOC entry 1692; 2606 19132 CONSTRAINT game_players_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "game_players_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY game_players
ADD CONSTRAINT game_players_idx_01 UNIQUE (game_id, player_id);
pg_restore: [archiver (db)] Error from TOC entry 1682; 2606 19163 CONSTRAINT hand_histories_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "hand_histories_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY hand_histories
ADD CONSTRAINT hand_histories_idx_01 UNIQUE (game_number, site_id, import_date);
pg_restore: [archiver (db)] Error from TOC entry 1665; 2606 19115 CONSTRAINT hand_rank_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "hand_rank_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY hand_rank
ADD CONSTRAINT hand_rank_idx_01 UNIQUE (hand_rank_id);
pg_restore: [archiver (db)] Error from TOC entry 1667; 2606 19106 CONSTRAINT player_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "player_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY players
ADD CONSTRAINT player_idx_01 UNIQUE (screen_name, main_site_id);
pg_restore: [archiver (db)] Error from TOC entry 1669; 2606 19108 CONSTRAINT player_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "player_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY players
ADD CONSTRAINT player_idx_02 UNIQUE (player_id);
pg_restore: [archiver (db)] Error from TOC entry 1672; 2606 19111 CONSTRAINT poker_sites_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "poker_sites_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY poker_sites
ADD CONSTRAINT poker_sites_idx_01 UNIQUE (site_id);
pg_restore: [archiver (db)] Error from TOC entry 1674; 2606 19113 CONSTRAINT poker_sites_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "poker_sites_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY poker_sites
ADD CONSTRAINT poker_sites_idx_02 UNIQUE (site_abbrev);
pg_restore: [archiver (db)] Error from TOC entry 1676; 2606 19117 CONSTRAINT prefs_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "prefs_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY prefs
ADD CONSTRAINT prefs_idx_01 UNIQUE (pref_key);
pg_restore: [archiver (db)] Error from TOC entry 1698; 2606 19127 CONSTRAINT session_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "session_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY "session"
ADD CONSTRAINT session_idx_01 UNIQUE (session_id);
pg_restore: [archiver (db)] Error from TOC entry 1712; 2606 19147 CONSTRAINT tourney_game_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_game_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney_game
ADD CONSTRAINT tourney_game_idx_01 UNIQUE (tourney_id, game_id);
pg_restore: [archiver (db)] Error from TOC entry 1714; 2606 19150 CONSTRAINT tourney_game_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_game_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney_game
ADD CONSTRAINT tourney_game_idx_02 UNIQUE (tourney_id, game_number);
pg_restore: [archiver (db)] Error from TOC entry 1716; 2606 19152 CONSTRAINT tourney_game_idx_03b postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_game_idx_03b"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney_game
ADD CONSTRAINT tourney_game_idx_03b UNIQUE (tourney_id, ub_game_number);
pg_restore: [archiver (db)] Error from TOC entry 1719; 2606 19155 CONSTRAINT tourney_game_players_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_game_players_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney_game_players
ADD CONSTRAINT tourney_game_players_idx_01 UNIQUE (tourney_id, game_id, player_id);
pg_restore: [archiver (db)] Error from TOC entry 1706; 2606 19141 CONSTRAINT tourney_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney
ADD CONSTRAINT tourney_idx_01 UNIQUE (tourney_id);
pg_restore: [archiver (db)] Error from TOC entry 1708; 2606 19143 CONSTRAINT tourney_idx_02 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_idx_02"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney
ADD CONSTRAINT tourney_idx_02 UNIQUE (site_id, tourney_number);
pg_restore: [archiver (db)] Error from TOC entry 1724; 2606 19160 CONSTRAINT tourney_summary_idx_01 postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not create unique index "tourney_summary_idx_01"
DETAIL: Table contains duplicated values.
Command was: ALTER TABLE ONLY tourney_summary
ADD CONSTRAINT tourney_summary_idx_01 UNIQUE (tourney_id, player_id);
WARNING: errors ignored on restore: 48

Process returned exit code 1.
AceInRed
 
Posts: 3
Joined: Sat Apr 12, 2008 8:23 am

Re: Restore from Backup

Postby ptrack pat » Sun May 17, 2009 6:55 pm

You get these warnings from the restore window using pgAdmin??
Where did you get this .backup file you are restoring from?

WARNING: errors ignored on restore: 48


Are you sure the restore did not work? Because these messages are stating the objects already exist, which is going to be true if the database you are restoring is one that already exists in PostgreSQL. It doesn't necessarily mean the restore would fail altogether.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: Restore from Backup

Postby AceInRed » Sat May 23, 2009 2:43 am

Hi,

yes I am sure. The restore was not successful. Here is what I did now:

1. I tried to make the restore function of PT work. I was asked to select the backup-file. I did that. Then the database was visible and could be selected (which was not the case before (see situation earlier in this thread), but it could not be opened. So I was asked to identify a program to open it with. I selected - not without difficulties - the pg_restore.exe in the postgres folder. It did not work to restore with the pgAdmin III-tool! Obviously the process worked, because I am shown that there is a database with the right name and the correct size. But now I can´t select it from PT. What can I do? I have not installed another database in PT before.

Best regards

Bernhard
AceInRed
 
Posts: 3
Joined: Sat Apr 12, 2008 8:23 am

Re: Restore from Backup

Postby ptrack pat » Sat May 23, 2009 8:15 am

But now I can´t select it from PT. What can I do? I have not installed another database in PT before.


You need to open the File > Maintain Database Names window, click the Add button, enter a description, and in the last field choose "Select existing PostgreSQL database" from the list and then select the database from the window that opens.

Then click OK to save.

Then use the File > Open Database option in PT.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Previous

Return to PostgreSQL Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron