473,692 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_ha ndler() 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 2812
Jerry LeVan <je*********@ek u.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.jp g')

the 22160 is the oid that represented the picture 'robasnowman.jp g'
16404 is the oid that identifies large objects,
0 is a subclass oid currently 0
'robasnowman.jp g' 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
2799
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? -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL:...
7
6938
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 which maintains the relationship between the BLOB loid and the identity that relates to it in my user tables. So far so good. When I RTFM obout psql it refers to the \lo_import, \lo_list, \lo_export and \lo_unlink functions.
7
4046
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 from the directories with the BLOB still hold the data ? Also one more very intriguing part is that if BLOBS are not deleted if we delete them from tables how to
1
3857
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 a TSM-backup, but could I have done something else? After the restore most databases worked again, with the exception of one: "SQL5005C" (System error). I had to restore the database from a
6
2049
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 me. Thanks. Vj.
0
992
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); I store pictures using (In Delphi 7)
1
1356
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. 2.) Copy both Saturday 4PM and Friday night full dump to the SAN.
5
4098
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 "there is not an effective way of backing up mysql without either suspending the service or causing latency problems connecting the database" are they bull s*****g me or are they correct?
3
3316
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 are the things to watch out for (apart from obvious ones like 'file not found' type errors). 2). How may a stored proc be written to fetch the BLOB data ? (An example would be very helpful) 3). How are errors handled in the stored proc that...
0
9083
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8797
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8800
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6459
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5818
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4323
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1957
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.