473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Lost my blobs and can't restore.

Hi,

I am just getting into large objects and bytea "stuff".
I created a small db called pictures and loaded some large
objects and then tried to do a restore.

Here is how I got the dump.

pg_dump -Fc -b pictures > /Users/jerry/desktop/db.comp

Here is the archive listing. Note I edited just to restore
the blobs.
;
; Archive created at Fri Aug 6 15:40:56 2004
; dbname: pictures
; TOC Entries: 14
; Compression: -1
; Dump Version: 1.7-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
;
;
; Selected TOC Entries:
;
;11; 21906 FUNC PROCEDURAL LANGUAGE plpgsql_call_handler() postgres
;10; 21907 PROCEDURAL LANGUAGE plpgsql
;4; 2200 ACL public postgres
;5; 21984 TABLE pics levan
;6; 22024 TABLE person levan
;12; 21984 TABLE DATA pics levan
;13; 22024 TABLE DATA person levan
14; 0 BLOBS BLOBS
;9; 21990 CONSTRAINT pics_ident_key levan
;7; 21982 SEQUENCE SET pics_ident_seq levan
;8; 22022 SEQUENCE SET person_id_seq levan
;3; 2200 COMMENT SCHEMA public postgres

toc 14 looks suspicious.

Here is what I did to restore:
pg_restore -L db.lst db.comp

This is the result of the command.
--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;

--
-- Data for TOC entry 14 (OID 0)
-- Name: BLOBS; Type: BLOBS; Schema: -; Owner:
-- Data Pos: 4843111
--

--
-- SKIPPED
--

pg_restore: [archiver] WARNING: skipping large-object restoration
[macjerry:~/desktop]$ pg_restore -L db.lst db.comp
--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;

--
-- Data for TOC entry 14 (OID 0)
-- Name: BLOBS; Type: BLOBS; Schema: -; Owner:
-- Data Pos: 4843111
--

--
-- SKIPPED
--

pg_restore: [archiver] WARNING: skipping large-object restoration

I even deleted the large objects via \lo_unlink but get the same
response.

OK, what am I doing wrong?

Jerry
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
2 2784
Jerry LeVan <je*********@eku.edu> writes:
pg_restore: [archiver] WARNING: skipping large-object restoration OK, what am I doing wrong?


You have to run pg_restore with a direct connection to a database. If
we could implement blob restoration with a noninteractive script, then
pg_dump would just emit scripts to do it ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2

Hmmm, still don't know if pg_restore will add the comments back....

Anyway I was able to recover my comments by sql that looks like

insert into pg_description values(22160 , 16404, 0, 'robasnowman.jpg')

the 22160 is the oid that represented the picture 'robasnowman.jpg'
16404 is the oid that identifies large objects,
0 is a subclass oid currently 0
'robasnowman.jpg' or whatever you want is the 'comment'

You have to be superuser to write the table (I think)

Fortunately I am getting ready to release the next version 1.3.3 of
BiggerSQL , it has the capability to display images stored in oids
and bytea fields so I was able to make a reasonable comment.

Jerry
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: steve | last post by:
Hi, When I copy tables in a database from one server to another using enterprise manager, everything copies ok, except for field defaults. Has anyone seen this, and what is the solution? --...
7
by: Howard Lowndes | last post by:
My situation is that I am interacting PHP 4.1.2 to PostgreSQL 7.2.2 I have no difficulty inserting and managing BLOBs into the Large Object system table, and I have a user table called images...
7
by: Nilabhra Banerjee | last post by:
Hi, I am still not sure whether the BLOBS are actually stored in the database or they have the pointer to the database for that file in the filesystem. If I remove the files (sources) for BLOBS...
1
by: Frederick Page | last post by:
Hi everybody, we're using DB2 7.2 FP 11 on WinNT machines, today one server was down, because the complete directory E:\DB2\NODE0000\SQLDBDIR was gone. Question: I restored this directory from...
6
by: vj | last post by:
I lost the database yesterday , due to some unknown reasons. Please let me know , where can i find the history or log of the activities which could have happened in my DB Server. Please advice...
0
by: Otto Blomqvist | last post by:
Hello ! I have a table that is created as follows Create Table file_200 (Record_number integer, Customer_Image OID; CREATE UNIQUE INDEX file_200_Record_Number_Key ON file_200 (record_number);...
1
by: kmounkhaty | last post by:
Hi Guru, This weekend, I migrated SQL Server7.0 to 2000 and below is the scenarios: 1.) At exactly 4:00PM on Sturday 17th, do full backup(T-SQL) and put a database into single user mode....
5
by: mantrid | last post by:
Hello My web hosting company has lost my data due to the mysql software failing, it only affected those people using innoDB engine. I asked them why they didnt restore from a back up. They said...
3
by: Annonymous Coward | last post by:
I remember readng that BLOBs can be stored externally (with reference to the BLOB file stored in tables instead). Does anyone have any experience doing this ? I have a few questions: 1).what...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.