pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Purusothaman A <purusothaman.a@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [GENERAL] OIDs - file objects, are damaged by PostgreSQL.
Date: Wed, 23 May 2007 16:47:40 +0100
Message-ID: <4654621C.8010700@archonet.com> (raw)
In-Reply-To: <3650d0d50705230756g5fdf8bdava3de463eb6f82ad9@mail.gmail.com>
References: <3650d0d50705152242y689c0ef8u56223ec15661c821@mail.gmail.com>
	<464AD62B.9000003@archonet.com>
	<3650d0d50705230134n15b993aat8bbc631836eef65e@mail.gmail.com>
	<46540766.2030108@archonet.com>
	<3650d0d50705230756g5fdf8bdava3de463eb6f82ad9@mail.gmail.com>

Purusothaman A wrote:
> Dear Richard Huxton,
> 
> Thanks for your quick reply.
> 
> only the first 3 values(HX, MASK, Rockey4ND) are file object's oid value.
> the other two are are not oid values.

Umm - OK. Can I suggest perhaps having different tables for different 
types of data?

> I have shown original output values displayed by postgresql client.
> 
> I can explain more.
> 
> 1. HX is a XML file. after downloading that file I opened that file in word
> pad application.
> In that I have noticed that nearly 20 characters of last line lost.
> 2. Rockey4ND is a dll file. I was unable to use that dll in my application.
> 
> In both cases, I checked file size. Corrupted files are smaller when 
> compare
> to the original one what I uploaded to postgresql.

OK, so the data seems OK up until that point?

> Usually this problem arises only after the database become large.

I can't think of any reason why that would make a difference. But, this 
does give us a clue. If you have successfully downloaded these files 
before, that rules out certain forms of failure.

> Any suggestion to rectify this problem would be nice of you.

Reading through recent release notes, I can't see anything mentioning 
lo_import/export, large objects or similar.

http://www.postgresql.org/docs/8.2/static/release-8-2-4.html

Well, your data is stored in pg_largeobject. If you run a SELECT you can 
see how it's broken into chunks.
   SELECT loid,pageno,length(data) FROM pg_largeobject ;

On my system, a full chunk is 2048 bytes long. What does the last chunk 
of your HX object (101800) look like? Is it a full chunk? Does it end 
where your downloaded file ends?

If the data is OK in pg_largeobject then we know we have a problem with 
lo_export-ing or saving to a file.

If not, then we know we have a problem with something deleting or 
overwriting chunks in pg_largeobject. That would surprise me, because I 
don't think there's anything special about pg_largeobject - it's just a 
table with chunks of bytea data in it.

Just to recap - you're using lo_import() and lo_export from C (or at 
least via libpq) to read/write these files directly to your filesystem. 
You've not been seeing crashes and you don't think you've got hardware 
problems.

-- 
   Richard Huxton
   Archonet Ltd



view thread (10+ messages)  latest in thread

Message-ID: <4654621C.8010700@archonet.com>
Permalink:  ../4654621C.8010700@archonet.com/
Also on:    postgresql.org/message-id/4654621C.8010700@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: dev@archonet.com, purusothaman.a@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] OIDs - file objects, are damaged by PostgreSQL.
  In-Reply-To: <4654621C.8010700@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox