Re: How can I find a broken row in a table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Khangelani Gama <Khangelani.Gama@xxxxxxxxxxxxxxxxxx> writes:
> Please help me, I am using PostgreSQL 7.3.4 running on Redhat5

> there is a table that has a broken row, but now I don't know which one
is broken. the table has about 20974 pages. is there a command to find
this?

You have to use divide-and-conquer.  Try

	select ctid from table limit N;

and vary N until you find the largest value that *doesn't* produce an
error.  The block number in the last ctid from that query is the block
before the bad one, or possibly a small number of blocks before the bad
one if there are some totally-empty blocks.

			regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux