simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

Partitions are not handled

Open sr1dar opened this issue 3 years ago • 4 comments

Describe the bug Partition definition is not handled by the parser, 'parse_from_file' Returns an empty list

To Reproduce Steps to reproduce the behavior:

Add this code to a simple create table query:

PARTITION BY col(id) ( PARTITION a VALUES('12') WITH (appendonly='false'), PARTITION b VALUES('9') WITH (appendonly='false') );

Expected behavior Return an non empty result or If there is a problem with partition,skip partition result instead of giving no result at all.

sr1dar avatar Mar 04 '22 10:03 sr1dar

@sr1dar hi, sorry for the delay, can you write in what DB this syntax is used? or better send the link to the doc :)

xnuinside avatar Mar 09 '22 12:03 xnuinside

@xnuinside Hello, This syntax is used in Green Plum Database (GPDB) Here is the link: https://gpdb.docs.pivotal.io/5290/admin_guide/ddl/ddl-partition.html

sr1dar avatar Mar 09 '22 15:03 sr1dar

Also the same problem exists when there is a check constraint along with a primary key constraint, CONSTRAINT new_check CHECK ((id = (3)::numeric))

and when INHERIT is present in the DDL: INHERITS(schemaname.tablename)

Both are GPDB syntaxes, Should I create a new issue for this? (Sorry I'm new to github)

sr1dar avatar Mar 09 '22 16:03 sr1dar

@sr1dar sorry, I forgot to answer, I need time to add new dialect

xnuinside avatar May 06 '22 14:05 xnuinside