Skip to content

DROP VIEW not supported in database: 'Postgresql' Expected ... but "V" found (DuckDB) #2291

@booandrew

Description

@booandrew

Describe the bug
I use DuckDB as my database engine and node-sql-parser configured with the Postgresql dialect. While most of the SQL statements work correctly, I encounter an error when trying to parse a DROP VIEW view_name statement.

Database Engine
DuckDB. I am using a parser with Postgresql option

To Reproduce

  1. Use the node-sql-parser library with the Postgresql dialect.
  2. Attempt to parse the following SQL statement:
   CREATE or replace VIEW view_name AS SELECT * FROM read_json_auto('https://api.datamuse.com/words?ml=sql'); 
   SELECT * from view_name; 
   DROP VIEW view_name;
  1. Got the error "Expected "--", "/*", ":=", "=", "INDEX", "TABLE", "TO", or [ \t\n\r] but "V" found."

Expected behavior
The node-sql-parser should successfully parse the DROP VIEW statement, as it is valid SQL syntax in the Postgresql dialect.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions