[BUGS] BUG #2386: pg_restore doesn't restore large objects
The following bug has been logged online: Bug reference: 2386 Logged by: Patrick Headley Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0.4 + Operating system: Windows XP Description:pg_restore doesn't restore large objects Details: I have been trying to restore some PostgreSQL databases with a single large object in them. By single I mean a single table with one lo and only one record. Using the pg_restore utility that ships with the Windows version of PGAdmin III v1.4.1 and 1.4.2 didn't work. I was finally able to restore the databases with the pg_restore that was on the Mac OS X machine hosting the PostgreSQL Server. Postgres was compiled and installed by using the Fink project. The version on that machine is 8.1.x. Backups don't seem to be the problem as I was able to make a backup using the Windows version of pg_backup that was shipped with PGAdmin III v1.4.2. I also tried v1.4.1 and though I didn't realize it was a restore problem the backups didn't error out in any way. The restore operation did error out in the same way. I tried restoring by using the pg_restore that ships with v1.4.1 and 1.4.2 of PGAdmin III on both a Windows XP machine to a Mac OS X 10.4 server hosting PostgreSQL v8.0.7 and on a Windows Server 2003 hosting it's own Postgres server v8.0.4 and from the Windows XP machine to the Windows Server 2003 machine. None of those combinations worked. What finally worked was logging onto the Mac OS X machine and running pg_restore from the bin directory. That machine has a Fink compiled and installed version of PostgreSQL. I don't know yet if the restore will work on the G4 machines but suspect that it will. It just seems to be something to do with the Windows dll. I thgought I saw something on a custom pg_restore but I don't remember where I saw that. Maybe I was using a custom pg_restore without knowing it. If so, and if this issue isn't a bug I appologize. However, I searched on the Internet for several hours while trying to figure out what to do and cannot find anything regarding this problem. Please let me know if there is something that I may have done wrong or if you can reproduce the symptom. Patrick Headley. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [BUGS] BUG #2386: pg_restore doesn't restore large objects
I'm a bit hurt by your statement that what I sent was just about useless :( The problem here is that I am new to PostgreSQL and PGAdmin III and so, in my confusion about what's normal and what's not, I am unable to provide you with all the details that would help you resolve the problem. However, I tried to be clear about what actions didn't work and those that did. Just as a point of reference, I was essentially thrown into the world of PostgreSQL where the installations were incomplete and the databases were poorly designed so the learning curve has been short and steep. So, let me try to explain this again. I recently added an LO object to a database using Peter Mount's LO type. So far, that's working. Yesterday, I made a backup of the database in order to restore it onto my test server. I used PGAdmin III to do the backup and it worked OK. Due to the problems I'm having with the restore, I tried the backup from two Mac OS X G4 servers and one Mac OS X Intel Dou server. All the backups were run from PGAdmin III and they all seem to work. I didn't attempt to restore every backup from every machine but they all ran the same and no error messages appeared. When I try to restore the backup using PGAdmin III, the log window begins to fill up. Near the end, when it should say it's restoring the BLOBS an error message appears stating the BLOBS couldn't be restored. I don't have the exact text of the message but I could get it for you if needed. I even created a test database with one table and two fields. The fields were recordid and logo (the LO type field). I couldn't even get this database to restore using PGAdmin III. The point here is that it doesn't matter which server I tried to restore too or which database I used (as long as it had at least one large object stored in it), if I used PGAdmin III, the same error message appeared at the same place in the process. However, if I restored the backup by opening a command or terminal window and ran the command from the command line, it worked. You should have no problem reproducing the same error message that I received. If you don't see the same problem, let me know and the next time I go to do a restore I'll get the details for you. By the way, when I put the backup file on one of the Macs and then ran the restore using the command line from the Mac Terminal window I was only prompted for a password once. However, when restoring the backup onto the Windows 2003 server I was prompted for the password at the beginning of the process and then just before restoring the BLOBs. Don't know how this might be related by I thought I would let you know. If you are unable to reproduce the problem by simply attempting to restore a backup of a database that has some LO data stored in it, let me know and I'll start from scratch and send you all the details that I can come up with. Patrick Headley Linx Consulting, Inc. (303) 916-5522 [EMAIL PROTECTED] www.linxco-inc.com -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 2:14 PM To: Patrick Headley Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #2386: pg_restore doesn't restore large objects "Patrick Headley" <[EMAIL PROTECTED]> writes: > Description:pg_restore doesn't restore large objects At no point did you show us exactly what you did or exactly what went wrong, so even though this report has a lot of version-number details, it's just about useless :-(. Please see the reporting suggestions at http://www.postgresql.org/docs/8.1/static/bug-reporting.html regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [BUGS] BUG #2386: pg_restore doesn't restore large objects
Andreas, I had another opportunity to do a restore for a client today. Both restore attempts that I'll be describing were to a remote Mac OS X machine with PostgreSQL 8.0.7 installed. Knowing that it wasn't going to work using PGAdmin III, I went directly to a command window on the machine with PGAdmin III v1.4.2 installed. The version of pg_restore on that machine is 8.1.3.6044. That machine is running Windows XP SP2. The following command, which didn't work was taken directly from the command window. I've removed the IP address and password for security reasons. C:\Program Files\pgAdmin III\1.4>pg_restore -i -h xx.xx.xx.xx -p 5432 -U password -d mtviewDEV -v C:\mtviewDEV.backup The restore errored out with the following lines: pg_restore: restoring large object data pg_restore: [archiver] could not create large object 28305 pg_restore: *** aborted because of error I then switched over to a Windows Server 2003 machine with PostgreSQL 8.0.4 installed and used pg_restore from the PostgreSQL bin folder. The version for pg_restore on that machine is v8.0.4.5277. On the Windows 2003 machine the restore worked. Only thing is that I lost a lot of the output from pg_restore that appeared in the command window because the lines scrolled out of the display buffer. However, at the point where the error occurred on the Windows XP machine the Windows 2003 machine prompted me for the password a second time. It then reported that it was restoring the large objects and then proceeded to restore other items in the database. Hope that provides some insights into the cause of the problem. Patrick Headley Linx Consulting, Inc. (303) 916-5522 [EMAIL PROTECTED] www.linxco-inc.com -Original Message- From: Andreas Pflug [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 3:52 AM To: Dave Page Cc: Bruce Momjian; Patrick Headley; Tom Lane; pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #2386: pg_restore doesn't restore large objects Dave Page wrote: > pgAdmin just uses pg_dump/pg_restore to handle the heavy lifting. > >>> When I try to restore the backup using PGAdmin III, the log >>> window begins to fill up. Near the end, when it should say it's >>> restoring the BLOBS an error message appears stating the BLOBS >>> couldn't be restored. This is the original output from pg_restore. pgAdmin will also log the precise parameters used to restore in the first log line, it might help to see those. Regards, Andreas ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq