xnuinside / simple-ddl-parser

Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
MIT License
179 stars 40 forks source link

Parsing Postgres 14 generated ddl results in error on ALTER statement #197

Open tduval-unifylogic opened 1 year ago

tduval-unifylogic commented 1 year ago

Describe the bug Found this this morning, parsing a postgres 14 generated ddl (via backup) results in error: ValueError: Found ALTER statement to not existed TABLE customers with SCHEMA public

To Reproduce Steps to reproduce the behavior: I added these steps so the output comes straight from postgres)

  1. Create database with the following Postgres generated DDL
  2. Right click on database, select backup (or just parse the attached file.
  3. Select file output location
  4. On General Tab, select output Plain
  5. On Data/Object Tab, select Only schema under 'Type of objects'
  6. Click Backup
  7. Run ddl-parser on file
  8. ValueError: Found ALTER statement to not existed TABLE customers with SCHEMA public

Expected behavior

Successful DDL Parse

Screenshots n/a

Desktop (please complete the following information):

Smartphone (please complete the following information): n/a

Additional context Add any other context about the problem here.

Expected behavior Successful DDL Parse

Screenshots n/a

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.