-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
is_not_null always false when visiting ColumnDef #150
Comments
TL;DR: That's a good question, but I cannot say if it is indeed a bug or not, I will have to forward the question to the underlying In the meantime, this is my reasoning: the ColumnDef structure effectively contains a This is what pglast obtains from the parser for your statement:
and this is what it gets removing that
as you can see, the main difference is the presence/absence of the Looking down in the pristine PostgreSQL sources, I see that that For some reason, As said, I will ask an opinion to the |
As explained by Lukas, that flag is indeed set by a later analysis step done by PG after that parse of the statement. |
Hi @lelit, thanks for the feedback and the explanation. Currently, one could check if there exists |
Right. |
The question on issue #150 clarified that the is_not_null flag is not set by libpg_query parser: instead of writing out something wrong, raise an exception should that behaviour change in the future.
Hi there,
First, thanks for this awesome project.
I am using visitors pattern to visit constraint node but I noticed
is_not_null
is always false irrespective ofnot null
defined on the column. Is this the expectation or may it is a bug?Example
output
This is the class representation
Thanks.
The text was updated successfully, but these errors were encountered: