---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/alter_materialized_view.sql
---
SOURCE_FILE
  COMMENT "-- rename_view"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    RENAME_TO
      RENAME_KW "rename"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "n"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    IF_EXISTS
      IF_KW "if"
      WHITESPACE " "
      EXISTS_KW "exists"
    WHITESPACE " "
    PATH
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "s"
      DOT "."
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    RENAME_TO
      RENAME_KW "rename"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "n"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- rename_column"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    RENAME_COLUMN
      RENAME_KW "rename"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "n"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    IF_EXISTS
      IF_KW "if"
      WHITESPACE " "
      EXISTS_KW "exists"
    WHITESPACE " "
    PATH
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "s"
      DOT "."
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " \n  "
    RENAME_COLUMN
      RENAME_KW "rename"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      TO_KW "to"
      WHITESPACE " "
      NAME
        IDENT "n"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- set_schema"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    SET_SCHEMA
      SET_KW "set"
      WHITESPACE " "
      SCHEMA_KW "schema"
      WHITESPACE " "
      NAME_REF
        IDENT "s"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    IF_EXISTS
      IF_KW "if"
      WHITESPACE " "
      EXISTS_KW "exists"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    SET_SCHEMA
      SET_KW "set"
      WHITESPACE " "
      SCHEMA_KW "schema"
      WHITESPACE " "
      NAME_REF
        IDENT "s"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- depends_extension"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    DEPENDS_ON_EXTENSION
      DEPENDS_KW "depends"
      WHITESPACE " "
      ON_KW "on"
      WHITESPACE " "
      EXTENSION_KW "extension"
      WHITESPACE " "
      NAME_REF
        IDENT "e"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    NO_DEPENDS_ON_EXTENSION
      NO_KW "no"
      WHITESPACE " "
      DEPENDS_KW "depends"
      WHITESPACE " "
      ON_KW "on"
      WHITESPACE " "
      EXTENSION_KW "extension"
      WHITESPACE " "
      NAME_REF
        IDENT "e"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- set_tablespace"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    ALL_KW "all"
    WHITESPACE " "
    IN_KW "in"
    WHITESPACE " "
    TABLESPACE_KW "tablespace"
    WHITESPACE " "
    NAME_REF
      IDENT "t"
    WHITESPACE "\n  "
    SET_KW "set"
    WHITESPACE " "
    TABLESPACE_KW "tablespace"
    WHITESPACE " "
    NAME
      IDENT "n"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    ALL_KW "all"
    WHITESPACE " "
    IN_KW "in"
    WHITESPACE " "
    TABLESPACE_KW "tablespace"
    WHITESPACE " "
    NAME_REF
      IDENT "t"
    WHITESPACE "\n  "
    OWNED_BY_ROLES
      OWNED_KW "owned"
      WHITESPACE " "
      BY_KW "by"
      WHITESPACE " "
      ROLE_REF_LIST
        ROLE_REF
          CURRENT_USER_KW "current_user"
        COMMA ","
        WHITESPACE " "
        ROLE_REF
          NAME_REF
            IDENT "u"
    WHITESPACE "\n  "
    SET_KW "set"
    WHITESPACE " "
    TABLESPACE_KW "tablespace"
    WHITESPACE " "
    NAME
      IDENT "n"
    WHITESPACE " "
    NOWAIT_KW "nowait"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_alter_col_stats"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " \n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STATISTICS
        SET_KW "set"
        WHITESPACE " "
        STATISTICS_KW "statistics"
        WHITESPACE " "
        LITERAL
          INT_NUMBER "100"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STATISTICS
        SET_KW "set"
        WHITESPACE " "
        STATISTICS_KW "statistics"
        WHITESPACE " "
        PREFIX_EXPR
          MINUS "-"
          LITERAL
            INT_NUMBER "1"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STATISTICS
        SET_KW "set"
        WHITESPACE " "
        STATISTICS_KW "statistics"
        WHITESPACE " "
        DEFAULT_KW "default"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_alter_col_set"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_OPTIONS
        SET_KW "set"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "n_distinct"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              LITERAL
                FLOAT_NUMBER "1.0"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_OPTIONS
        SET_KW "set"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "a"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              LITERAL
                TRUE_KW "true"
          COMMA ","
          WHITESPACE " "
          ATTRIBUTE_OPTION
            NAME
              IDENT "b"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              LITERAL
                INT_NUMBER "1"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_alter_col_reset"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      RESET_OPTIONS
        RESET_KW "reset"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "n_distinct"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      RESET_OPTIONS
        RESET_KW "reset"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "n_distinct"
          COMMA ","
          WHITESPACE " "
          ATTRIBUTE_OPTION
            NAME
              IDENT "n_distinct_inherited"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_alter_col_storage"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STORAGE
        SET_KW "set"
        WHITESPACE " "
        STORAGE_KW "storage"
        WHITESPACE " "
        IDENT "plain"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STORAGE
        SET_KW "set"
        WHITESPACE " "
        STORAGE_KW "storage"
        WHITESPACE " "
        EXTERNAL_KW "external"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STORAGE
        SET_KW "set"
        WHITESPACE " "
        STORAGE_KW "storage"
        WHITESPACE " "
        IDENT "extended"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STORAGE
        SET_KW "set"
        WHITESPACE " "
        STORAGE_KW "storage"
        WHITESPACE " "
        IDENT "main"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "s"
      DOT "."
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE " \n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_STORAGE
        SET_KW "set"
        WHITESPACE " "
        STORAGE_KW "storage"
        WHITESPACE " "
        DEFAULT_KW "default"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_alter_col_compression"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_COMPRESSION
        SET_KW "set"
        WHITESPACE " "
        COMPRESSION_KW "compression"
        WHITESPACE " "
        IDENT "pglz"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    ALTER_COLUMN
      ALTER_KW "alter"
      WHITESPACE " "
      COLUMN_KW "column"
      WHITESPACE " "
      NAME_REF
        IDENT "c"
      WHITESPACE " "
      SET_COMPRESSION
        SET_KW "set"
        WHITESPACE " "
        COMPRESSION_KW "compression"
        WHITESPACE " "
        IDENT "pglz"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_cluster"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    CLUSTER_ON
      CLUSTER_KW "cluster"
      WHITESPACE " "
      ON_KW "on"
      WHITESPACE " "
      NAME_REF
        IDENT "i"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- action_set_without_cluster"
  WHITESPACE "\n"
  ALTER_MATERIALIZED_VIEW
    ALTER_KW "alter"
    WHITESPACE " "
    MATERIALIZED_KW "materialized"
    WHITESPACE " "
    VIEW_KW "view"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME_REF
          IDENT "v"
    WHITESPACE "\n  "
    SET_WITHOUT_CLUSTER
      SET_KW "set"
      WHITESPACE " "
      WITHOUT_KW "without"
      WHITESPACE " "
      CLUSTER_KW "cluster"
  SEMICOLON ";"
  WHITESPACE "\n\n"
