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

Fail to parse Postgres CREATE TABLE statement with GENERATED ALWAYS AS IDENTITY(INCREMENT BY 1...) #257

Open
vanbastun opened this issue May 19, 2024 · 1 comment

Comments

@vanbastun
Copy link

Hello.

To Reproduce
ddl = """CREATE TABLE IF NOT EXISTS public.generator_id (
hall_id int4 GENERATED ALWAYS AS IDENTITY( INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START 1 CACHE 1 NO CYCLE) NOT NULL,
hall_name varchar(50) NOT NULL,
CONSTRAINT hall_pkey PRIMARY KEY (hall_id)); ""

parse_results = DDLParser(ddl, silent=False, log_file='parser19052.log', log_level=logging.DEBUG).run()

Error 1: simple_ddl_parser.ddl_parser.DDLParserError: Unknown statement at LexToken(BY,'BY',1,105)
if delete the word 'BY' after 'INCREMENT'
Error 2: simple_ddl_parser.ddl_parser.DDLParserError: Unknown statement at LexToken(NO,'NO',1,154)

Expected behavior
parsed output

Desktop (please complete the following information):

  • OS: [Windows10]
  • Python 3.11.5
  • simple_ddl_parser 1.3.0

Additional context
log_file='parser19052.log' log file was created but was empty and never was populated.

Thank You!

@xnuinside
Copy link
Owner

@vanbastun thanks for opening the issue, I will check!

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

2 participants