Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-734

add "CREATE TABLE table_a LIKE table_b" syntax

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • 603

    Description

      Add create table like syntax:

      antlr definition:
      ```antlr
      create_table_like_node returns [CreateTableLikeStatement ret]
      : CREATE TABLE new_table=from_table_name LIKE base_table=from_table_name

      {ret = factory.createTableLike(new_table, base_table, getBindCount());}

      ;
      ```
      and the sql will be like this:
      ```sql
      CREATE TABLE test LIKE table_b;
      ```

      Attachments

        Activity

          People

            Unassigned Unassigned
            haitaoyao Haitao Yao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: