cache lookup failed for type 0 - Mailing list pgsql-hackers

From Gaetano Mendola
Subject cache lookup failed for type 0
Date
Msg-id 41123B74.8030606@bigfoot.com
Whole thread Raw
List pgsql-hackers
Hi all,
doing some tests:


regression=# create table test (a integer);
CREATE TABLE
regression=# alter table test add column b test;
ALTER TABLE
regression=# select * from test; a | b
---+---
(0 rows)

regression=# insert into test values ( 1, (2,null));   <--(1)
INSERT 4260928 1

regression=# \d test     Table "public.test" Column |  Type   | Modifiers
--------+---------+----------- a      | integer | b      | test    |

regression=# alter table test drop column a;
ALTER TABLE
regression=# insert into test values ( (3,null));
ERROR:  cache lookup failed for type 0

regression=# select * from test; b
---- ()
(1 row)

regression=# alter table test add column c integer;
ALTER TABLE
kalman=# select * from test;  b  | c
-----+--- (,) |
(1 row)

regression=# insert into test values ( (null,3), 4);  <--(2)
ERROR:  cannot cast type record to test
DETAIL:  Input has wrong number of columns.

regression=# \d test     Table "public.test" Column |  Type   | Modifiers
--------+---------+----------- b      | test    | c      | integer |



The two insert in (1) and (2) are the same ( change only the column order ),
but the (1) works and the (2) not.



Regards
Gaetano Mendola














pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Open items
Next
From: Gaetano Mendola
Date:
Subject: table with no column with some rows inside !!