Thread: "no relation entry for relid 1"

"no relation entry for relid 1"

From
Peter Geoghegan
Date:
I've built Postgres from master, and found that the following fairly
simple query breaks:

select count(*)
from
(
    select
    schemaname
    from        pg_stat_user_tables
    order by     1=09
) sub
group by schemaname

This produces the internal error message "no relation entry for relid
1". Why is that?

--=20
Peter Geoghegan =A0 =A0 =A0 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Re: "no relation entry for relid 1"

From
Merlin Moncure
Date:
On Thu, Sep 29, 2011 at 3:26 PM, Peter Geoghegan <peter@2ndquadrant.com> wr=
ote:
> I've built Postgres from master, and found that the following fairly
> simple query breaks:
>
> select count(*)
> from
> (
> =A0 =A0 =A0 =A0select
> =A0 =A0 =A0 =A0schemaname
> =A0 =A0 =A0 =A0from =A0 =A0 =A0 =A0 =A0 =A0pg_stat_user_tables
> =A0 =A0 =A0 =A0order by =A0 =A0 =A0 =A01
> ) sub
> group by schemaname
>
> This produces the internal error message "no relation entry for relid
> 1". Why is that?

hm -- works for me (9.1.0)

merlin

Re: "no relation entry for relid 1"

From
Peter Geoghegan
Date:
On 29 September 2011 21:59, Merlin Moncure <mmoncure@gmail.com> wrote:
> hm -- works for me (9.1.0)

It works for me on REL9_1_STABLE too, unsurprisingly, as I would think
it highly unlikely that such a glaring bug would slip into a stable
release.

--=20
Peter Geoghegan =A0 =A0 =A0 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Re: "no relation entry for relid 1"

From
"Dickson S. Guedes"
Date:
2011/9/29 Peter Geoghegan <peter@2ndquadrant.com>:
> On 29 September 2011 21:59, Merlin Moncure <mmoncure@gmail.com> wrote:
>> hm -- works for me (9.1.0)
>
> It works for me on REL9_1_STABLE too, unsurprisingly, as I would think
> it highly unlikely that such a glaring bug would slip into a stable
> release.

Have you did a make distclean before build, then init a new $PGDATA?

--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br

Re: "no relation entry for relid 1"

From
Mark Kirkwood
Date:
On 30/09/11 10:08, Dickson S. Guedes wrote:
> 2011/9/29 Peter Geoghegan<peter@2ndquadrant.com>:
>> On 29 September 2011 21:59, Merlin Moncure<mmoncure@gmail.com>  wrote:
>>> hm -- works for me (9.1.0)
>> It works for me on REL9_1_STABLE too, unsurprisingly, as I would think
>> it highly unlikely that such a glaring bug would slip into a stable
>> release.
> Have you did a make distclean before build, then init a new $PGDATA?
>

I can confirm this - checkout from 2 days ago, maintainer-clean + build
and initdb.

Re: "no relation entry for relid 1"

From
Tom Lane
Date:
Peter Geoghegan <peter@2ndquadrant.com> writes:
> I've built Postgres from master, and found that the following fairly
> simple query breaks:

> select count(*)
> from
> (
>     select
>     schemaname
>     from        pg_stat_user_tables
>     order by     1
> ) sub
> group by schemaname

> This produces the internal error message "no relation entry for relid
> 1". Why is that?

Looks like I broke it here:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1cb108efb0e60d87e4adec38e7636b6e8efbeb57

Fixed, thanks for the report!

            regards, tom lane

Re: "no relation entry for relid 1"

From
Peter Geoghegan
Date:
On 29 September 2011 23:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Geoghegan <peter@2ndquadrant.com> writes:
>> I've built Postgres from master, and found that the following fairly
>> simple query breaks:
>
>> select count(*)
>> from
>> (
>> =A0 =A0 =A0 select
>> =A0 =A0 =A0 schemaname
>> =A0 =A0 =A0 from =A0 =A0 =A0 =A0 =A0 =A0pg_stat_user_tables
>> =A0 =A0 =A0 order by =A0 =A0 =A0 =A01
>> ) sub
>> group by schemaname
>
>> This produces the internal error message "no relation entry for relid
>> 1". Why is that?
>
> Looks like I broke it here:
>
> http://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D1=
cb108efb0e60d87e4adec38e7636b6e8efbeb57

Hmm. Although it was obvious to me that this was an internal error, I
have to wonder what a novice would have made of it. Specifically, I
wonder if there should be an INTERNAL_ERROR severity level, to
explicitly advertise that you're not supposed to see this, and to help
log analysis tools (including grep) bring these sorts of things to the
DBA's attention, as they are surely much more severe than most errors
seen in practice.

--=20
Peter Geoghegan =A0 =A0 =A0 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

Re: "no relation entry for relid 1"

From
Tom Lane
Date:
Peter Geoghegan <peter@2ndquadrant.com> writes:
> On 29 September 2011 23:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Looks like I broke it here:
>> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=1cb108efb0e60d87e4adec38e7636b6e8efbeb57

> Hmm. Although it was obvious to me that this was an internal error, I
> have to wonder what a novice would have made of it. Specifically, I
> wonder if there should be an INTERNAL_ERROR severity level, to
> explicitly advertise that you're not supposed to see this, and to help
> log analysis tools (including grep) bring these sorts of things to the
> DBA's attention, as they are surely much more severe than most errors
> seen in practice.

Well, the SQLSTATE for this sort of thing is already
ERRCODE_INTERNAL_ERROR.  As to whether it's more severe than other
errors, I'm not convinced.  It didn't crash, nor corrupt your data.

            regards, tom lane