Purusothaman A wrote:
> Richard Huxton,
>
> Thanks for your detailed reply.
>
> I am maintaining various database of same kind in postgresql.
> Here I have shown various corrupted last line of output of select * from
> pg_largeobject where oid = xxxxxx; in 5 databases.
>
> I have used '\o e:\\filename.xml' before executing query and inspected the
> output in that file.
>
> Kindly look at the end of line in all 5 outputs.
> First 3 output shows few missing characters.
> But last 2 output is the perfect one.
>
> 1. Output of SFRS2 database:
> 2. Output of SFRS1 database:
> 3. Output of FASP_AVT database:
Let's have a look at the last few bytes of these three rows. For
example, below is a very short file that finishes with "end<NL>".
SELECT loid,pageno,length(data),encode(data, 'hex') FROM pg_largeobject
WHERE loid=340161 AND pageno=0;
loid | pageno | length | encode
--------+--------+--------+----------------------------------------------------------------
340161 | 0 | 31 |
54686973206973206120746573742066696c650a6c696e6520320a656e640a
(1 row)
It doesn't seem to be random garbage at the end of your rows, so lets
see what it is.
Oh - things we can rule out:
1. Index corruption. We're not missing the last row.
Adding the length check above will show us if the row is truncated or
full of spaces.
--
Richard Huxton
Archonet Ltd