2

How to modify a field using jsonPath in PostgreSQL like SQL Server JSON_MODIFY (https://learn.microsoft.com/en-us/sql/t-sql/functions/json-modify-transact-sql?view=sql-server-ver15)?

Thanks!

3
  • 1
    jsonb_set() postgresql.org/docs/current/functions-json.html Commented May 25, 2020 at 16:17
  • jsonb_set does not support jsonPath, it has a different path format Commented May 25, 2020 at 17:00
  • Well, that's the only way to modify a JSON value in Postgres. Commented May 25, 2020 at 18:09

1 Answer 1

0

There are currently no ways to update JSON properties using JsonPath. The only way is with jsonb query jsonb_set

Sign up to request clarification or add additional context in comments.

1 Comment

That's not correct anymore since PostgreSQL 14, see this answer to a different question: stackoverflow.com/a/71794798/4300087

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.