Why we don't panic in PageGetExactFreeSpace

Started by Zdenek Kotalaover 17 years ago3 messages
#1Zdenek Kotala
Zdenek.Kotala@Sun.COM

The PageGetExactFreeSpace function contains following code:

00486 space = (int) ((PageHeader) page)->pd_upper -
00487 (int) ((PageHeader) page)->pd_lower;
00488
00489 if (space < 0)
00490 return 0;

It seems to me that we should panic that data are overlaped instead of return
zero. See PageHeaderIsValid for reference.

Any comments?

Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zdenek Kotala (#1)
Re: Why we don't panic in PageGetExactFreeSpace

Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:

It seems to me that we should panic that data are overlaped instead of return
zero.

elog(PANIC) is almost never a good idea, and it certainly isn't a good
response here.

regards, tom lane

#3Zdenek Kotala
Zdenek.Kotala@Sun.COM
In reply to: Tom Lane (#2)
Re: Why we don't panic in PageGetExactFreeSpace

Tom Lane napsal(a):

Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:

It seems to me that we should panic that data are overlaped instead of return
zero.

elog(PANIC) is almost never a good idea, and it certainly isn't a good
response here.

Ok PANIC is too strong, but I guess FATAL should be relevant or is there any
situation when lower > upper? The same situation is in PageGetFreeSpace.

Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql