Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER VIEW Fails #170

Open
DVGY opened this issue Sep 24, 2024 · 0 comments
Open

ALTER VIEW Fails #170

DVGY opened this issue Sep 24, 2024 · 0 comments

Comments

@DVGY
Copy link

DVGY commented Sep 24, 2024

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;);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant