You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that involves a lot of manipulation and adding to the original tree that comes into the service.
I am a little bit scared to try and handle all edge cases when I am inserting and moving nodes around so I am trying to use as much of the original tree as possible rather than error handling on every single attribute.
Is there any risk with having the “location” value out of order within an array or within a branch of a tree?
Is there any risk of not having location declared on a node at all?
The deparse method does not seem to care, but want to make sure.
The text was updated successfully, but these errors were encountered:
You can leave the location field empty (causing it to be 0), or set it to -1 (which is what Postgres uses when the location is unknown).
The location doesn't matter at all for passing things into the deparser, so it shouldn't be needed for your use case.
Its originally intended to provide the user context of where an error in the query occurred (i.e. when parsing an error is hit), has some use in the pg_stat_statements normalization, and in pg_query some users make use of it when trying to figure out where in the source query a particular AST item is. But all of that doesn't matter for passing things into the deparser.
I am working on a project that involves a lot of manipulation and adding to the original tree that comes into the service.
I am a little bit scared to try and handle all edge cases when I am inserting and moving nodes around so I am trying to use as much of the original tree as possible rather than error handling on every single attribute.
Is there any risk with having the “location” value out of order within an array or within a branch of a tree?
Is there any risk of not having location declared on a node at all?
The deparse method does not seem to care, but want to make sure.
The text was updated successfully, but these errors were encountered: