pganalyze / libpg_query

C library for accessing the PostgreSQL parser outside of the server environment
BSD 3-Clause "New" or "Revised" License
1.21k stars 182 forks source link

Parsing query result doesn't match protobuf definition. #212

Closed Yo-mah-Ya closed 1 year ago

Yo-mah-Ya commented 1 year ago

I'd say that the definition written in protobuf is completely compatible with the query results executed by C programs, but is it not? I founded some difference, for example,

But actually, pg_query_parse returns { String: { str: "id" } } like this. https://github.com/pganalyze/libpg_query/blob/009f19d7f867a699e1beab5fd545fbc07ad35647/protobuf/pg_query.proto#L275-L278

https://github.com/pganalyze/libpg_query/blob/009f19d7f867a699e1beab5fd545fbc07ad35647/protobuf/pg_query.proto#L300-L311

Are these intended to be like this, I mean, does it not need to be fixed for some reasons what I couldn't notice? Or needs for fixed? If it needs to be fixed, we might as well wanna generate .proto file from C sources themselves instead of Ruby script and JSON to keep solid data type across languages.

Yo-mah-Ya commented 1 year ago

I used version 13 binary, but I saw version 15 protobuffer definition.. and then there were no difference as mentioned above... sorry !