"no relation entry for relid 1"

Started by Peter Geogheganover 14 years ago8 messagesbugs
Jump to latest

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?

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

#2Merlin Moncure
mmoncure@gmail.com
In reply to: Peter Geoghegan (#1)
Re: "no relation entry for relid 1"

On Thu, Sep 29, 2011 at 3:26 PM, Peter Geoghegan <peter@2ndquadrant.com> wrote:

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?

hm -- works for me (9.1.0)

merlin

In reply to: Merlin Moncure (#2)
Re: "no relation entry for relid 1"

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.

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

#4Dickson S. Guedes
listas@guedesoft.net
In reply to: Peter Geoghegan (#3)
Re: "no relation entry for relid 1"

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

#5Mark Kirkwood
mark.kirkwood@catalyst.net.nz
In reply to: Dickson S. Guedes (#4)
Re: "no relation entry for relid 1"

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.

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Geoghegan (#1)
Re: "no relation entry for relid 1"

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

In reply to: Tom Lane (#6)
Re: "no relation entry for relid 1"

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
(
      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

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.

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

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Geoghegan (#7)
Re: "no relation entry for relid 1"

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