Skip to content

ALTER VIEW Fails #170

Description

@DVGY
Error: Syntax error at line 1 col 12:

1  ALTER VIEW THEAA RENAME TO new_view_name;
              ^
Unexpected word token: "theaa". I did not expect any more input. Here is the state of my parse table:

    kw_index → %word ●
    kw_sequence → %word ●
    kw_type → %word ●

    at Parser.feed (F:\gitLocal\which-migration\node_modules\.pnpm\nearley@2.20.1\node_modules\nearley\lib\nearley.js:343:27)    at _parse (F:\gitLocal\which-migration\node_modules\.pnpm\pgsql-ast-parser@12.0.1\node_modules\pgsql-ast-parser\index.js:1925:16)
    at doParse (F:\gitLocal\which-migration\node_modules\.pnpm\pgsql-ast-parser@12.0.1\node_modules\pgsql-ast-parser\index.js:1880:27)
    at parse (F:\gitLocal\which-migration\node_modules\.pnpm\pgsql-ast-parser@12.0.1\node_modules\pgsql-ast-parser\index.js:1883:11)
    at parseFirst (F:\gitLocal\which-migration\node_modules\.pnpm\pgsql-ast-parser@12.0.1\node_modules\pgsql-ast-parser\index.js:1862:19)
    at Object.<anonymous> (F:\gitLocal\which-migration\packages\server\src\pg\controller\sqlexec\sqlexec.js:15:13)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12) {
  offset: 2,
  token: {
    type: 'word',
    value: 'theaa',
    text: 'THEAA',
    toString: [Function: tokenToString],
    offset: 11,
    lineBreaks: 0,
    line: 1,
    col: 12
  }
}

const { parseFirst } = require("pgsql-ast-parser");
const ast = parseFirst(ALTER VIEW THEAA RENAME TO new_view_name;);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions