title: What's the best way to store an enum type in postgres being used in a join table?
body: <p>I have have the following three tables:</p>
  <p><strong>Movie Types</strong></p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TYPE category AS ENUM ('comedy', 'drama', 'action', 'thriller');
  
  CREATE TABLE movie_types (
      id BIGSERIAL PRIMARY KEY,
      category category NOT NULL
  );
  
  Column |  Type  |                     Modifiers
  --------+--------+----------------------------------------------------
  id     | bigint | not null
  category | category | not null
  </code></pre>
  <p><strong>Movie to Movie types joins table</strong></p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE movie_categories (
      id BIGSERIAL PRIMARY KEY,
      movie_type_id FOREIGN KEY REFERENCES movie_type(id)
      movie_id FOREIGN KEY REFERENCES movie(id)
  );
  
  Column |  Type  |                     Modifiers
  --------+--------+----------------------------------------------------
  id     | bigint | not null
  movie_type_id | category | not null
  movie_id | category | not null
  </code></pre>
  <p><strong>Movies</strong></p>
  <pre class="lang-sql prettyprint-override"><code>
  CREATE TABLE movies (
      id BIGSERIAL PRIMARY KEY,
      name varchar
  );
  
  Column |  Type  |                     Modifiers
  --------+--------+----------------------------------------------------
  id     | bigint | not null
  name | string | not null
  </code></pre>
  <p>The Movie types is limited list of categories stored as an enum. A movie can have several different categories associated with it.</p>
  <p>What's the best practice when storing something in a similar data model? I using the enum type here good practice or is it better to just use varchar for category in movie_types?</p>