title: ERROR: recursive query "t" column 3 has type character varying(255) in non-recursive term but type character varying overall
body: <p>I have this table.</p>
  <pre><code>CREATE TABLE directory (
    id           INT NOT NULL,
    parent_id    INT,
    label        character varying(255),
    
    CONSTRAINT pk_directory PRIMARY KEY (id),
    CONSTRAINT fk_directory FOREIGN KEY (parent_id) REFERENCES t_directory (id)
  );
  </code></pre>
  <p>I'm trying to build a hierarchy so I have done this in jOOQ.</p>
  <pre><code>CommonTableExpression&lt;?&gt; cte = name(&quot;t&quot;).fields(
    &quot;id&quot;,
    &quot;name&quot;,
    &quot;path&quot;
  ).as(
    select(
      DIRECTORY.ID,
      DIRECTORY.LABEL,
      DIRECTORY.LABEL)
    .from(DIRECTORY)
    .where(DIRECTORY.PARENT_ID.isNull())
    .unionAll(
    select(
      DIRECTORY.ID,
      DIRECTORY.LABEL,
      field(name(&quot;t&quot;, &quot;path&quot;), VARCHAR)
        .concat(&quot;\\&quot;)
        .concat(DIRECTORY.LABEL))
    .from(table(name(&quot;t&quot;)))
    .join(DIRECTORY)
    .on(field(name(&quot;t&quot;, &quot;id&quot;), INTEGER)
      .eq(DIRECTORY.PARENT_ID)))
  );
  
  System.out.println(
      create().withRecursive(cte)
              .selectFrom(cte)
              .fetch()
  );
  </code></pre>
  <p>But I get this error:</p>
  <blockquote>
  <p>ERROR: recursive query &quot;t&quot; column 3 has type character varying(255) in
  non-recursive term but type character varying overall</p>
  </blockquote>
  <p>If I change the cast from VARCHAR to TEXT it works but <strong>PostgresDataType.TEXT</strong> is deprecated and shouldn't be used.</p>
  <p>Anyone knows the solution?</p>
  <p>Thanks</p>