Skip site navigation (1) Skip section navigation (2)

Re: TidScan needs handling of a corner cases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
Cc: "PGSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TidScan needs handling of a corner cases
Date: 2008-04-30 21:03:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com> writes:
> postgres=# explain analyze select ctid, * from pg_class where ctid in (
> '(6,1)' );
> ERROR:  could not read block 6 of relation 1663/11511/1259: read only 0 of
> 8192 bytes

I was about to say that throwing an error for this is just fine, but on
closer investigation we didn't throw an error before 8.3; the behavioral
change is because mdread() now throws an error for out-of-bounds read.
So for consistency with historical behavior this probably needs to be

>     Also, it is known that 0 is not a valid row-offset in the block, but the
> tid input function accepts this value (it rejects -ve values). For the same
> setup:

Not sure what you think needs to be fixed in this case?  Again,
backwards compatibility seems a reason not to change it; and I sure
don't see why you'd want to throw an error for this case but not the
other one.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-04-30 21:33:38
Subject: Re: Protection from SQL injection
Previous:From: Martijn van OosterhoutDate: 2008-04-30 20:58:34
Subject: Re: Protection from SQL injection

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group