title: Create a table of two types in PostgreSQL
body: <p>I have created two types:</p>
  
  <pre><code>Create  Type info_typ_1 AS (
  Prod_id integer, 
  category integer);
  
  Create Type movie_typ AS(
  title varchar(50),
  actor varchar(50),
  price float);
  </code></pre>
  
  <p>And I want to create a table that consists of these two types. I know that for a table that consists of one type, it's:</p>
  
  <pre><code>CREATE TABLE Table1 of type1
  (
    primary key(prod_id)
  );
  </code></pre>
  
  <p>Is there any way to do that for the two types I created above?</p>
  
  <p>What I tried doing(which is wrong), is creating a third type that contains the first two:</p>
  
  <pre><code>Create Type info_ AS (
  info info_typ_1,
  movie movie_typ);
  </code></pre>
  
  <p>and then creating the table:</p>
  
  <pre><code>CREATE TABLE table1 of info_
  (
    primary key(Prod_id)
  );
  </code></pre>
  
  <p>But it doesn't work. I get this error:</p>
  
  <pre><code>ERROR:  column "prod_id" named in key does not exist
  LINE 3:   primary key(Prod_id)
            ^
  ********** Error **********
  
  ERROR: column "prod_id" named in key does not exist
  SQL state: 42703
  Character: 43
  </code></pre>