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

regression: can't update boolean values with postico 1.0.7 #227

Closed
qwesda opened this Issue May 31, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@qwesda

qwesda commented May 31, 2016

The Numbers in generated SQL are no longer quoted feature introduced a bug, where boolean values can't be updated anymore in the table view. Changing a bool value generates for example this query:

UPDATE "statements"."statement_issuer_revenue_type" SET "is_stream"=1 WHERE "id_statement_issuer_revenue_type"=1 RETURNING ...

in older build the generated statement was:

UPDATE "statements"."statement_issuer_revenue_type" SET "is_stream"='1' WHERE "id_statement_issuer_revenue_type"='1' RETURNING ...

At least postgres 9.5.1 doesn't cast the integer value to bool implicitly. (I'm a bit surprised, that it accepts a string here. thought only mysql did this ...)

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Jun 1, 2016

Owner

Thanks for catching this! Fixed it in Postico 1.0.8.

PostgreSQL doesn't actually cast strings to bools implicitly. It just assumes that the literal is of type BOOL.

From the manual:

If the expression is an unknown-type literal, the contents of the literal string will be fed to the input conversion routine for the target type.

Owner

jakob commented Jun 1, 2016

Thanks for catching this! Fixed it in Postico 1.0.8.

PostgreSQL doesn't actually cast strings to bools implicitly. It just assumes that the literal is of type BOOL.

From the manual:

If the expression is an unknown-type literal, the contents of the literal string will be fed to the input conversion routine for the target type.

@jakob jakob closed this Jun 1, 2016

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Jun 1, 2016

I see ...

Come to think of it, the same thing is happening with date or range literals.

qwesda commented Jun 1, 2016

I see ...

Come to think of it, the same thing is happening with date or range literals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment