Skip to content

fix: parse WITH NO SCHEMA BINDING on CREATE VIEW - #2941

Merged
manticore-projects merged 2 commits into
JSQLParser:masterfrom
harryfoster2006:fix/redshift-no-schema-binding
Nov 21, 2026
Merged

manticore-projects merged 2 commits into
JSQLParser:masterfrom
harryfoster2006:fix/redshift-no-schema-binding

Conversation

@harryfoster2006

Copy link
Copy Markdown
Contributor

Redshift late-binding views end with WITH NO SCHEMA BINDING, so this fails to parse:

CREATE VIEW v AS (SELECT a FROM t) WITH NO SCHEMA BINDING

CreateView only accepted WITH READ ONLY, WITH [CASCADED|LOCAL] CHECK OPTION and WITH [NO] DATA after the query.

Syntax reference: https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_VIEW.html

Change

  • Grammar: accept WITH NO SCHEMA BINDING after the view query. A two-token lookahead on NO SCHEMA keeps it distinct from WITH NO DATA. BINDING is a contextual keyword, so it is not reserved.
  • CreateView: new withNoSchemaBinding flag with getter, setter and withWithNoSchemaBinding(...), emitted by appendOptionsAfterQueryTo, so both toString() and CreateViewDeParser round-trip it.
  • Test: RedshiftCreateViewTest.lateBindingView covers a parenthesised select, OR REPLACE with a schema-qualified name and column list, and the flag being set.

harryfoster2006 and others added 2 commits November 18, 2026 16:16
Redshift late-binding views end with WITH NO SCHEMA BINDING. Accept the
clause after the view query, keep it on CreateView and deparse it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@manticore-projects
manticore-projects merged commit 3b6040d into JSQLParser:master Nov 21, 2026
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants