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

parse errors when parse create table statement #56

Open
chuxiangfeng opened this issue Sep 15, 2022 · 1 comment
Open

parse errors when parse create table statement #56

chuxiangfeng opened this issue Sep 15, 2022 · 1 comment

Comments

@chuxiangfeng
Copy link

it can not parse Postgres create table sql , with partition by, example:
sql = """create table aaa
(
id integer default nextval('aaa_id_seq'::regclass) not null,
name varchar
) partition by RANGE (name)"""
print(psqlparse.parse(sql))

throw an exception as:

Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/chuxiangfeng/PycharmProjects/pythonEffectiveS/tools/sqlparse.py", line 14, in
print(psqlparse.parse(sql))
File "psqlparse/parser.pyx", line 28, in psqlparse.parser.parse (psqlparse/parser.c:1042)
psqlparse.exceptions.PSqlParseError: syntax error at or near "partition"

@alculquicondor
Copy link
Owner

alculquicondor commented Sep 15, 2022

The version of the library is likely too old for it.

I no longer maintain this package, but I'm willing to transfer the maintainer role.

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