Thread: Database "template1" does not exist in the system catalog.
When I try to connect to template1 via psql, I get the following error message: psql: FATAL: Database "template1" does not exist in the system catalog. I get a similar error when trying to do a pg_dumpall. In searching the list and trying to find a good place to start, I downloaded pgfsck and I tried the following: # ./pgfsck -s 8192 -D data-corrupt template1 -- Detected database format 7.3 -- Table pg_class(1259):Page 0: Incorrect value in header (incorrect blocksize?) -- 00 00 00 00 00 47 A7 CC 00 00 00 09 00 E8 01 5C 20 00 20 01 -- Table pg_class(1259):Page 0: Incorrect value in header (incorrect blocksize?) -- 00 00 00 00 00 47 FE CC 00 00 00 09 00 E8 01 58 20 00 20 01 -- Table pg_class(1259):Page 0: Incorrect value in header (incorrect blocksize?) -- 00 00 00 00 00 48 35 88 00 00 00 09 00 E8 0E E8 20 00 20 01 Couldn't find class 'pg_attribute' I am 99% sure the block size truly is 8192, but I could be wrong; I tried other combinations and didn't get any better results. I wasn't really sure what to make of this error, but noticed the 1259 and figured that was a file name. I then tried downloading pg_filedump and tried the following: # ./pg_filedump data-corrupt/base/1/1259 (See results below) Am I headed in the right direction? Any chance of recovering some/all of the data? Thanks, Aaron ***************************************************************** * PostgreSQL File/Block Formatted Dump Utility - Version 1.1 * * File: /Applications/altona/data-corrupt/base/1/1259 * Options used: None * * Dump created on: Tue Jan 11 04:11:26 2005 ***************************************************************** Block 0 ****************************************************** <Header> ----- Block Offset: 0x00000000 Offsets: Lower 232 (0x00e8) Block: Size 8192 Version 1 Upper 348 (0x015c) LSN: logid 0 recoff 0x0047a7cc Special 8192 (0x2000) Items: 53 Free Space: 116 Length (including item array): 236 <Data> ------ Item 1 -- Length: 180 Offset: 4308 (0x10d4) Flags: USED Item 2 -- Length: 180 Offset: 4128 (0x1020) Flags: USED Item 3 -- Length: 180 Offset: 3948 (0x0f6c) Flags: USED Item 4 -- Length: 180 Offset: 3768 (0x0eb8) Flags: USED Item 5 -- Length: 180 Offset: 3588 (0x0e04) Flags: USED Item 6 -- Length: 180 Offset: 3408 (0x0d50) Flags: USED Item 7 -- Length: 180 Offset: 3228 (0x0c9c) Flags: USED Item 8 -- Length: 152 Offset: 8040 (0x1f68) Flags: USED Item 9 -- Length: 180 Offset: 3048 (0x0be8) Flags: USED Item 10 -- Length: 180 Offset: 2868 (0x0b34) Flags: USED Item 11 -- Length: 180 Offset: 2688 (0x0a80) Flags: USED Item 12 -- Length: 180 Offset: 2508 (0x09cc) Flags: USED Item 13 -- Length: 180 Offset: 2328 (0x0918) Flags: USED Item 14 -- Length: 180 Offset: 2148 (0x0864) Flags: USED Item 15 -- Length: 180 Offset: 1968 (0x07b0) Flags: USED Item 16 -- Length: 180 Offset: 1788 (0x06fc) Flags: USED Item 17 -- Length: 180 Offset: 1608 (0x0648) Flags: USED Item 18 -- Length: 180 Offset: 1428 (0x0594) Flags: USED Item 19 -- Length: 180 Offset: 1248 (0x04e0) Flags: USED Item 20 -- Length: 180 Offset: 1068 (0x042c) Flags: USED Item 21 -- Length: 180 Offset: 888 (0x0378) Flags: USED Item 22 -- Length: 180 Offset: 708 (0x02c4) Flags: USED Item 23 -- Length: 180 Offset: 528 (0x0210) Flags: USED Item 24 -- Length: 180 Offset: 348 (0x015c) Flags: USED Item 25 -- Length: 0 Offset: 4460 (0x116c) Flags: 0x00 Item 26 -- Length: 0 Offset: 4312 (0x10d8) Flags: 0x00 Item 27 -- Length: 0 Offset: 4164 (0x1044) Flags: 0x00 Item 28 -- Length: 0 Offset: 4016 (0x0fb0) Flags: 0x00 Item 29 -- Length: 0 Offset: 3868 (0x0f1c) Flags: 0x00 Item 30 -- Length: 148 Offset: 7892 (0x1ed4) Flags: USED Item 31 -- Length: 148 Offset: 7744 (0x1e40) Flags: USED Item 32 -- Length: 148 Offset: 7596 (0x1dac) Flags: USED Item 33 -- Length: 148 Offset: 7448 (0x1d18) Flags: USED Item 34 -- Length: 148 Offset: 7300 (0x1c84) Flags: USED Item 35 -- Length: 148 Offset: 7152 (0x1bf0) Flags: USED Item 36 -- Length: 148 Offset: 7004 (0x1b5c) Flags: USED Item 37 -- Length: 148 Offset: 6856 (0x1ac8) Flags: USED Item 38 -- Length: 148 Offset: 6708 (0x1a34) Flags: USED Item 39 -- Length: 148 Offset: 6560 (0x19a0) Flags: USED Item 40 -- Length: 148 Offset: 6412 (0x190c) Flags: USED Item 41 -- Length: 148 Offset: 6264 (0x1878) Flags: USED Item 42 -- Length: 148 Offset: 6116 (0x17e4) Flags: USED Item 43 -- Length: 148 Offset: 5968 (0x1750) Flags: USED Item 44 -- Length: 148 Offset: 5820 (0x16bc) Flags: USED Item 45 -- Length: 148 Offset: 5672 (0x1628) Flags: USED Item 46 -- Length: 148 Offset: 5524 (0x1594) Flags: USED Item 47 -- Length: 148 Offset: 5376 (0x1500) Flags: USED Item 48 -- Length: 148 Offset: 5228 (0x146c) Flags: USED Item 49 -- Length: 148 Offset: 5080 (0x13d8) Flags: USED Item 50 -- Length: 148 Offset: 4932 (0x1344) Flags: USED Item 51 -- Length: 148 Offset: 4784 (0x12b0) Flags: USED Item 52 -- Length: 148 Offset: 4636 (0x121c) Flags: USED Item 53 -- Length: 148 Offset: 4488 (0x1188) Flags: USED Block 1 ****************************************************** <Header> ----- Block Offset: 0x00002000 Offsets: Lower 232 (0x00e8) Block: Size 8192 Version 1 Upper 344 (0x0158) LSN: logid 0 recoff 0x0047fecc Special 8192 (0x2000) Items: 53 Free Space: 112 Length (including item array): 236 <Data> ------ Item 1 -- Length: 148 Offset: 8044 (0x1f6c) Flags: USED Item 2 -- Length: 148 Offset: 7896 (0x1ed8) Flags: USED Item 3 -- Length: 148 Offset: 7748 (0x1e44) Flags: USED Item 4 -- Length: 148 Offset: 7600 (0x1db0) Flags: USED Item 5 -- Length: 148 Offset: 7452 (0x1d1c) Flags: USED Item 6 -- Length: 148 Offset: 7304 (0x1c88) Flags: USED Item 7 -- Length: 148 Offset: 7156 (0x1bf4) Flags: USED Item 8 -- Length: 148 Offset: 7008 (0x1b60) Flags: USED Item 9 -- Length: 148 Offset: 6860 (0x1acc) Flags: USED Item 10 -- Length: 148 Offset: 6712 (0x1a38) Flags: USED Item 11 -- Length: 148 Offset: 6564 (0x19a4) Flags: USED Item 12 -- Length: 148 Offset: 6416 (0x1910) Flags: USED Item 13 -- Length: 148 Offset: 6268 (0x187c) Flags: USED Item 14 -- Length: 148 Offset: 6120 (0x17e8) Flags: USED Item 15 -- Length: 148 Offset: 5972 (0x1754) Flags: USED Item 16 -- Length: 148 Offset: 5824 (0x16c0) Flags: USED Item 17 -- Length: 148 Offset: 5676 (0x162c) Flags: USED Item 18 -- Length: 148 Offset: 5528 (0x1598) Flags: USED Item 19 -- Length: 148 Offset: 5380 (0x1504) Flags: USED Item 20 -- Length: 148 Offset: 5232 (0x1470) Flags: USED Item 21 -- Length: 148 Offset: 5084 (0x13dc) Flags: USED Item 22 -- Length: 148 Offset: 4936 (0x1348) Flags: USED Item 23 -- Length: 148 Offset: 4788 (0x12b4) Flags: USED Item 24 -- Length: 148 Offset: 4640 (0x1220) Flags: USED Item 25 -- Length: 148 Offset: 4492 (0x118c) Flags: USED Item 26 -- Length: 148 Offset: 4344 (0x10f8) Flags: USED Item 27 -- Length: 148 Offset: 4196 (0x1064) Flags: USED Item 28 -- Length: 148 Offset: 4048 (0x0fd0) Flags: USED Item 29 -- Length: 180 Offset: 2684 (0x0a7c) Flags: USED Item 30 -- Length: 180 Offset: 2504 (0x09c8) Flags: USED Item 31 -- Length: 180 Offset: 2324 (0x0914) Flags: USED Item 32 -- Length: 180 Offset: 2144 (0x0860) Flags: USED Item 33 -- Length: 180 Offset: 1964 (0x07ac) Flags: USED Item 34 -- Length: 148 Offset: 3900 (0x0f3c) Flags: USED Item 35 -- Length: 148 Offset: 3752 (0x0ea8) Flags: USED Item 36 -- Length: 180 Offset: 1784 (0x06f8) Flags: USED Item 37 -- Length: 180 Offset: 1604 (0x0644) Flags: USED Item 38 -- Length: 180 Offset: 1424 (0x0590) Flags: USED Item 39 -- Length: 148 Offset: 3604 (0x0e14) Flags: USED Item 40 -- Length: 148 Offset: 3456 (0x0d80) Flags: USED Item 41 -- Length: 180 Offset: 1244 (0x04dc) Flags: USED Item 42 -- Length: 180 Offset: 1064 (0x0428) Flags: USED Item 43 -- Length: 180 Offset: 884 (0x0374) Flags: USED Item 44 -- Length: 148 Offset: 3308 (0x0cec) Flags: USED Item 45 -- Length: 148 Offset: 3160 (0x0c58) Flags: USED Item 46 -- Length: 180 Offset: 704 (0x02c0) Flags: USED Item 47 -- Length: 180 Offset: 524 (0x020c) Flags: USED Item 48 -- Length: 180 Offset: 344 (0x0158) Flags: USED Item 49 -- Length: 148 Offset: 3012 (0x0bc4) Flags: USED Item 50 -- Length: 148 Offset: 2864 (0x0b30) Flags: USED Item 51 -- Length: 0 Offset: 592 (0x0250) Flags: 0x00 Item 52 -- Length: 0 Offset: 444 (0x01bc) Flags: 0x00 Item 53 -- Length: 0 Offset: 296 (0x0128) Flags: 0x00 Block 2 ****************************************************** <Header> ----- Block Offset: 0x00004000 Offsets: Lower 232 (0x00e8) Block: Size 8192 Version 1 Upper 3816 (0x0ee8) LSN: logid 0 recoff 0x00483588 Special 8192 (0x2000) Items: 53 Free Space: 3584 Length (including item array): 236 <Data> ------ Item 1 -- Length: 148 Offset: 8044 (0x1f6c) Flags: USED Item 2 -- Length: 148 Offset: 7896 (0x1ed8) Flags: USED Item 3 -- Length: 180 Offset: 6156 (0x180c) Flags: USED Item 4 -- Length: 180 Offset: 5976 (0x1758) Flags: USED Item 5 -- Length: 180 Offset: 5796 (0x16a4) Flags: USED Item 6 -- Length: 148 Offset: 7748 (0x1e44) Flags: USED Item 7 -- Length: 148 Offset: 7600 (0x1db0) Flags: USED Item 8 -- Length: 180 Offset: 5616 (0x15f0) Flags: USED Item 9 -- Length: 180 Offset: 5436 (0x153c) Flags: USED Item 10 -- Length: 180 Offset: 5256 (0x1488) Flags: USED Item 11 -- Length: 148 Offset: 7452 (0x1d1c) Flags: USED Item 12 -- Length: 148 Offset: 7304 (0x1c88) Flags: USED Item 13 -- Length: 180 Offset: 5076 (0x13d4) Flags: USED Item 14 -- Length: 180 Offset: 4896 (0x1320) Flags: USED Item 15 -- Length: 180 Offset: 4716 (0x126c) Flags: USED Item 16 -- Length: 148 Offset: 7156 (0x1bf4) Flags: USED Item 17 -- Length: 148 Offset: 7008 (0x1b60) Flags: USED Item 18 -- Length: 188 Offset: 6820 (0x1aa4) Flags: USED Item 19 -- Length: 180 Offset: 4536 (0x11b8) Flags: USED Item 20 -- Length: 180 Offset: 4356 (0x1104) Flags: USED Item 21 -- Length: 148 Offset: 6672 (0x1a10) Flags: USED Item 22 -- Length: 148 Offset: 6524 (0x197c) Flags: USED Item 23 -- Length: 180 Offset: 4176 (0x1050) Flags: USED Item 24 -- Length: 180 Offset: 3996 (0x0f9c) Flags: USED Item 25 -- Length: 180 Offset: 3816 (0x0ee8) Flags: USED Item 26 -- Length: 0 Offset: 4296 (0x10c8) Flags: 0x00 Item 27 -- Length: 0 Offset: 4148 (0x1034) Flags: 0x00 Item 28 -- Length: 0 Offset: 4000 (0x0fa0) Flags: 0x00 Item 29 -- Length: 0 Offset: 3852 (0x0f0c) Flags: 0x00 Item 30 -- Length: 0 Offset: 3704 (0x0e78) Flags: 0x00 Item 31 -- Length: 0 Offset: 3556 (0x0de4) Flags: 0x00 Item 32 -- Length: 0 Offset: 3408 (0x0d50) Flags: 0x00 Item 33 -- Length: 0 Offset: 3260 (0x0cbc) Flags: 0x00 Item 34 -- Length: 0 Offset: 3112 (0x0c28) Flags: 0x00 Item 35 -- Length: 0 Offset: 2964 (0x0b94) Flags: 0x00 Item 36 -- Length: 188 Offset: 6336 (0x18c0) Flags: USED Item 37 -- Length: 0 Offset: 2628 (0x0a44) Flags: 0x00 Item 38 -- Length: 0 Offset: 2480 (0x09b0) Flags: 0x00 Item 39 -- Length: 0 Offset: 2332 (0x091c) Flags: 0x00 Item 40 -- Length: 0 Offset: 2184 (0x0888) Flags: 0x00 Item 41 -- Length: 0 Offset: 2036 (0x07f4) Flags: 0x00 Item 42 -- Length: 0 Offset: 1888 (0x0760) Flags: 0x00 Item 43 -- Length: 0 Offset: 1740 (0x06cc) Flags: 0x00 Item 44 -- Length: 0 Offset: 1592 (0x0638) Flags: 0x00 Item 45 -- Length: 0 Offset: 1444 (0x05a4) Flags: 0x00 Item 46 -- Length: 0 Offset: 1296 (0x0510) Flags: 0x00 Item 47 -- Length: 0 Offset: 1148 (0x047c) Flags: 0x00 Item 48 -- Length: 0 Offset: 1000 (0x03e8) Flags: 0x00 Item 49 -- Length: 0 Offset: 852 (0x0354) Flags: 0x00 Item 50 -- Length: 0 Offset: 704 (0x02c0) Flags: 0x00 Item 51 -- Length: 0 Offset: 556 (0x022c) Flags: 0x00 Item 52 -- Length: 0 Offset: 408 (0x0198) Flags: 0x00 Item 53 -- Length: 0 Offset: 260 (0x0104) Flags: 0x00 *** End of File Encountered. Last Block Read: 2 *** _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
"Aaron Mark" <aaronmarkmn@hotmail.com> writes: > When I try to connect to template1 via psql, I get the following error > message: > psql: FATAL: Database "template1" does not exist in the system catalog. Hm, can you connect to any other databases? If so, what does "select * from pg_database" show? regards, tom lane
Unfortunately, I can't seem to connect to any other database. I only had one non-system database so I tried that, and that I was thinking there was a template0, so I tried that as well. Thanks in advance for any help you can provide! Aaron >From: Tom Lane <tgl@sss.pgh.pa.us> >To: "Aaron Mark" <aaronmarkmn@hotmail.com> >CC: pgsql-general@postgresql.org >Subject: Re: [GENERAL] Database "template1" does not exist in the system >catalog. Date: Tue, 11 Jan 2005 00:33:09 -0500 > >"Aaron Mark" <aaronmarkmn@hotmail.com> writes: > > When I try to connect to template1 via psql, I get the following error > > message: > > psql: FATAL: Database "template1" does not exist in the system catalog. > >Hm, can you connect to any other databases? If so, what does "select * >from pg_database" show? > > regards, tom lane > >---------------------------(end of broadcast)--------------------------- >TIP 8: explain analyze is your friend _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar � get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/