Skip to content
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

Fails to update jsonb field #673

Closed
mesgar opened this issue May 22, 2023 · 1 comment
Closed

Fails to update jsonb field #673

mesgar opened this issue May 22, 2023 · 1 comment

Comments

@mesgar
Copy link

mesgar commented May 22, 2023

Exception:
Npgsql.PostgresException: 42804: column "message" is of type jsonb but expression is of type text

Code:
json = new {message = JsonConvert.SerializeObject(data)};
affected = db.Query("xxxxx").Where(whereLeft, whereRight).Update(json);

SQL:
The query runs fine by itself.
image

Npgsql Version: 7.0.4
SQLKata Version: 2.4.0

🙏

@mesgar
Copy link
Author

mesgar commented May 24, 2023

This answer did the trick!

for now you can use the db.Statement method

🙏

@mesgar mesgar closed this as completed May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant