Lukas Fittl

Results 217 comments of Lukas Fittl

@camilovietnam You may find it helpful to look at the Postgres source code directly - all that that pg_query does is package the Postgres internal AST structs in a way...

Hi @hcheng2002cn, Yes, this is since the Postgres parser special cases the character data types (see here: https://github.com/postgres/postgres/blob/master/src/backend/parser/gram.y#L13095) When you specify the type as `"char"` on the other hand you...

Hi @bryanburgers - thanks for reaching out! The answer is, it depends a bit on which part of the tree you are looking at. In most node types you have...

There has been effort in upstream PostgreSQL to add query location and length on all top-level parse nodes. So far it hasn't been merged into Postgres 10, but it might...

@bryanburgers I've just completed rebasing this library to the Postgres 10 parser (beta1, still subject to change) The branch is available here: https://github.com/lfittl/libpg_query/tree/10-latest This introduces `RawStmt` nodes that are on...

@inad9300 Good question - there is no documentation per se, but there are JSON files that contain definitions, so you should be able to auto-generate things from there. The files...

I'm suspecting the issue here is that you have `nodes` twice (once as a variable, once as an import) Could you try renaming the variable in `nodes := tree.Statements` to...

@ChaosEternal Its a good question - I think this is out of scope for libpq to be honest, and the likely response would be "who needs this, really?". The other...

@davidfetter That is a good question. I think there is value in offering this in core on a running server (i.e. requiring a live DB connection), and it would likely...

@davidfetter Nice, I think that makes sense - ideally we could still have the raw parser without analysis accessible as a standalone library, but this could complement each other well....