Unable to create table of view row type - Mailing list pgsql-hackers

From Isaac Morland
Subject Unable to create table of view row type
Date
Msg-id CAMsGm5fdArGBaWVPx1=VbvuDsF11o=+gVLYB4_8DmKWMfWxLZw@mail.gmail.com
Whole thread Raw
List pgsql-hackers
I thought I should be able to do this:

=> create view testv as values (1, 'a'), (2, 'b'), (3, 'c');
CREATE VIEW
=> create table testt of testv;
ERROR:  type testv is not a composite type

But as you can see I can’t. pg_type seems to think the type is composite:

ijmorlan=> select typtype from pg_type where typname = 'testv';
 typtype
─────────
 c
(1 row)

I’m guessing there are good reasons this isn’t supported, so I’m thinking to provide a documentation patch for CREATE TABLE and ALTER TABLE to specify that the type given for OF type_name must be a non-relation-row-type composite type.

Am I missing something?

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: refactoring relation extension and BufferAlloc(), faster COPY
Next
From: Greg Stark
Date:
Subject: Commitfest Manager