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 » Wed Mar 18, 2009 2:28 am

;
; Archive created at Thu Jan 22 17:04:15 2009
; dbname: POKERDB
; TOC Entries: 97
; Compression: -1
; Dump Version: 1.10-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 8.3.5
; Dumped by pg_dump version: 8.3.5
;
;
; Selected TOC Entries:
;
3; 2615 2200 SCHEMA - public postgres
1907; 0 0 COMMENT - SCHEMA public postgres
1908; 0 0 ACL - public postgres
1523; 1259 16399 TABLE public blind_structure postgres
1541; 1259 16495 TABLE public datawindow_prefs postgres
1524; 1259 16405 TABLE public dst postgres
1540; 1259 16489 TABLE public error_msgs postgres
1525; 1259 16408 TABLE public exrates postgres
1532; 1259 16447 TABLE public game postgres
1530; 1259 16435 TABLE public game_level postgres
1533; 1259 16453 TABLE public game_players postgres
1531; 1259 16441 TABLE public hand_histories postgres
1526; 1259 16411 TABLE public hand_rank postgres
1535; 1259 16465 TABLE public player_winnings postgres
1527; 1259 16417 TABLE public players postgres
1528; 1259 16423 TABLE public poker_sites postgres
1529; 1259 16429 TABLE public prefs postgres
1534; 1259 16459 TABLE public session postgres
1536; 1259 16468 TABLE public tourney postgres
1542; 1259 16501 TABLE public tourney_desc postgres
1537; 1259 16474 TABLE public tourney_game postgres
1538; 1259 16480 TABLE public tourney_game_players postgres
1539; 1259 16486 TABLE public tourney_summary postgres
1543; 1259 16507 TABLE public tourney_type postgres
1522; 1259 16393 TABLE public version_info postgres
1883; 0 16399 TABLE DATA public blind_structure postgres
1901; 0 16495 TABLE DATA public datawindow_prefs postgres
1884; 0 16405 TABLE DATA public dst postgres
1900; 0 16489 TABLE DATA public error_msgs postgres
1885; 0 16408 TABLE DATA public exrates postgres
1892; 0 16447 TABLE DATA public game postgres
1890; 0 16435 TABLE DATA public game_level postgres
1893; 0 16453 TABLE DATA public game_players postgres
1891; 0 16441 TABLE DATA public hand_histories postgres
1886; 0 16411 TABLE DATA public hand_rank postgres
1895; 0 16465 TABLE DATA public player_winnings postgres
1887; 0 16417 TABLE DATA public players postgres
1888; 0 16423 TABLE DATA public poker_sites postgres
1889; 0 16429 TABLE DATA public prefs postgres
1894; 0 16459 TABLE DATA public session postgres
1896; 0 16468 TABLE DATA public tourney postgres
1902; 0 16501 TABLE DATA public tourney_desc postgres
1897; 0 16474 TABLE DATA public tourney_game postgres
1898; 0 16480 TABLE DATA public tourney_game_players postgres
1899; 0 16486 TABLE DATA public tourney_summary postgres
1903; 0 16507 TABLE DATA public tourney_type postgres
1882; 0 16393 TABLE DATA public version_info postgres
1811; 2606 16693 CONSTRAINT public blind_structure_idx_01 postgres
1813; 2606 16695 CONSTRAINT public blind_structure_idx_02 postgres
1881; 2606 16763 CONSTRAINT public datawindow_prefs_idx_01 postgres
1815; 2606 16697 CONSTRAINT public exrates_idx_01 postgres
1836; 2606 16716 CONSTRAINT public game_idx_01 postgres
1838; 2606 16718 CONSTRAINT public game_idx_02 postgres
1840; 2606 16720 CONSTRAINT public game_idx_03b postgres
1830; 2606 16699 CONSTRAINT public game_level_idx_01 postgres
1832; 2606 16701 CONSTRAINT public game_level_idx_02 postgres
1844; 2606 16729 CONSTRAINT public game_players_idx_01 postgres
1834; 2606 16759 CONSTRAINT public hand_histories_idx_01 postgres
1817; 2606 16712 CONSTRAINT public hand_rank_idx_01 postgres
1819; 2606 16703 CONSTRAINT public player_idx_01 postgres
1821; 2606 16705 CONSTRAINT public player_idx_02 postgres
1824; 2606 16708 CONSTRAINT public poker_sites_idx_01 postgres
1826; 2606 16710 CONSTRAINT public poker_sites_idx_02 postgres
1828; 2606 16714 CONSTRAINT public prefs_idx_01 postgres
1850; 2606 16724 CONSTRAINT public session_idx_01 postgres
1864; 2606 16744 CONSTRAINT public tourney_game_idx_01 postgres
1866; 2606 16746 CONSTRAINT public tourney_game_idx_02 postgres
1868; 2606 16748 CONSTRAINT public tourney_game_idx_03b postgres
1871; 2606 16751 CONSTRAINT public tourney_game_players_idx_01 postgres
1858; 2606 16738 CONSTRAINT public tourney_idx_01 postgres
1860; 2606 16740 CONSTRAINT public tourney_idx_02 postgres
1876; 2606 16756 CONSTRAINT public tourney_summary_idx_01 postgres
1878; 1259 16760 INDEX public error_msgs_idx01 postgres
1879; 1259 16761 INDEX public error_msgs_idx02 postgres
1841; 1259 16721 INDEX public game_idx_04 postgres
1842; 1259 16722 INDEX public game_idx_05 postgres
1845; 1259 16730 INDEX public game_players_idx_02 postgres
1846; 1259 16731 INDEX public game_players_idx_03 postgres
1847; 1259 16732 INDEX public game_players_idx_04 postgres
1848; 1259 16733 INDEX public game_players_idx_05 postgres
1854; 1259 16734 INDEX public player_winnings_idx_01 postgres
1855; 1259 16735 INDEX public player_winnings_idx_02 postgres
1856; 1259 16736 INDEX public player_winnings_idx_ad postgres
1822; 1259 16706 INDEX public players_idx_03 postgres
1851; 1259 16725 INDEX public session_idx_02 postgres
1852; 1259 16726 INDEX public session_idx_03 postgres
1853; 1259 16727 INDEX public session_idx_04 postgres
1869; 1259 16749 INDEX public tourney_game_idx_04 postgres
1872; 1259 16752 INDEX public tourney_game_players_idx_02 postgres
1873; 1259 16753 INDEX public tourney_game_players_idx_03 postgres
1874; 1259 16754 INDEX public tourney_game_players_idx_04 postgres
1861; 1259 16741 INDEX public tourney_idx_03 postgres
1862; 1259 16742 INDEX public tourney_idx_04 postgres
1877; 1259 16757 INDEX public tourney_summary_idx_02 postgres
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby ptrack pat » Wed Mar 18, 2009 8:42 am

You said you are being prompted to select the pg_restore.exe file when you do the restore. Are you selecting the pg_restore.exe file from the c:\program files\postgresql\8.3\bin folder or some other folder? If you aren't selecting it from the ..\8.3\bin folder then try that.

If you are, go to Start > Programs > PostgreSQL 8.3 > pgAdmin III

Right-click on the red X at the top left of the window that opens and select connect from the popup menu.
When prompted for a password, just hit OK, you don't need to enter it.
In the list of databases, do you see one called POKERDB there?
If so, right-click on it and select Restore from the popup menu. On the window that opens, click the "..." button next to the File Name field and choose you .backup file. Click OK to start the backup. Does this work?
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: Restore from Backup

Postby dbot2006 » Wed Mar 25, 2009 2:19 am

I am selecting the pg_restore.exe file from the c:\program files\postgresql\8.3\bin
In the list of databases I do not see POKERDB.

Image
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby ptrack pat » Wed Mar 25, 2009 9:04 am

You need to create it then. Click the Tools > Query Tool menu option.

Copy and paste the following text into the window that opens...then hit F5 to run it. When you close the window afterwards, right-click on "Databases" and select "Refresh" from the popup menu.

CREATE DATABASE "POKERDB"
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;
ALTER DATABASE "POKERDB" SET enable_seqscan=off;
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: Restore from Backup

Postby dbot2006 » Wed Mar 25, 2009 7:41 pm

I have completed the instructions. As far as I can tell, nothing has changed. When I ran F5 it asked me to save the resulting SQL file then immediately afterward it asked me to locate the file I just saved. After refreshing the database list I see nothing new.
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby ptrack pat » Wed Mar 25, 2009 9:24 pm

Hitting F5 should have executed the statement, not attempted to save anything. Run it again, instead of hitting F5, use the Query > Execute menu option and look at the status section at the bottom of the window. What does it say there?
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: Restore from Backup

Postby dbot2006 » Wed Mar 25, 2009 11:49 pm

ERROR: CREATE DATABASE cannot be executed from a function or multi-command string

********** Error **********

ERROR: CREATE DATABASE cannot be executed from a function or multi-command string
SQL state: 25001
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby ptrack pat » Thu Mar 26, 2009 8:42 am

Are you sure you copy/pasted exactly what I gave you above? I tested this before I entered it in the last reply and it works fine for me.

Copy/paste just this part of the statement and execute it...

CREATE DATABASE "POKERDB"
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

Re: Restore from Backup

Postby dbot2006 » Thu Mar 26, 2009 9:36 pm

I tried that last code several times.
This new code adds a new entry into the database list but PT still behaves the same way.
When I try to restore the database the dos window opens and closes and nothing has changed.

-- Executing query:
CREATE DATABASE "POKERDB"
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;

Query returned successfully with no result in 5522 ms.
dbot2006
 
Posts: 10
Joined: Mon Jan 05, 2009 5:03 pm

Re: Restore from Backup

Postby ptrack pat » Thu Mar 26, 2009 11:35 pm

I already told you in the previous thread that you need to restore the database using pgAdmin. Click on the POKERDB database, right-click on it and select Restore from the popup menu. On the window that opens, click the "..." button next to the File Name field and choose you .backup file. Click OK to start the backup.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

PreviousNext

Return to PostgreSQL Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron