BUG #5514: no relation entry for relid X - Mailing list pgsql-bugs

From Marcos Castedo
Subject BUG #5514: no relation entry for relid X
Date
Msg-id 201006202202.o5KM2fue093245@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5514: no relation entry for relid X  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5514
Logged by:          Marcos Castedo
Email address:      marcos.castedo@anachronics.com
PostgreSQL version: 8.4.4
Operating system:   GNU/Linux
Description:        no relation entry for relid X
Details:

Hi,

I'm getting an error in some kind of SQL expression (subquery referencing a
tuple from parent expression).
This error raise in 8.4.x version of postgres, but previous version (8.3.x)
execute the expression correctly.

Examples:

CREATE TABLE table_a
(
id integer primary key
);

CREATE VIEW view_a as select * FROM table_a;

SELECT (SELECT view_a) FROM view_a;

PostgreSQL 8.3.9 (works fine):

postgres=# SELECT (SELECT view_a) FROM view_a;
 ?column?
----------
(0 rows)

postgres=# INSERT INTO table_a VALUES (1);

postgres=# SELECT (SELECT view_a.*) FROM view_a;
 ?column?
----------
        1

postgres=# SELECT (SELECT (view_a.*)::text) FROM view_a;
 ?column?
----------
 (1)
(1 row)


PostgreSQL 8.4.4 (ERROR:  no relation entry for relid x):

postgres=# SELECT (SELECT view_a) FROM view_a;
ERROR:  no relation entry for relid 1

postgres=# INSERT INTO table_a VALUES (1);

postgres=# SELECT (SELECT (view_a.*)::text) FROM view_a;
ERROR:  no relation entry for relid 1

postgres=# SELECT (SELECT view_a.*) FROM view_a;
 ?column?
----------
        1

postgres=# SELECT (SELECT (a.*)::text) FROM view_a a;
ERROR:  no relation entry for relid 1


Best regards

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: BUG #5512: Password error message
Next
From: "Elior"
Date:
Subject: BUG #5513: High availability with Postgres