JSON Patch (RFC 6902) support?
This is my first email to the PostgreSQL mailing lists so I hope this is
the correct place. If not, please let me know.
I was wondering if it would be possible and wise to support JSON Patch?
https://tools.ietf.org/html/rfc6902
One of the problems I have as a user is how to update a portion of a JSON
object efficiently. Right now I have to read the entire field from the
database, update it, and then write it back. I am thinking JSON Patch might
be a good way to solve this problem because it would allow partial updates
and I think it could easily fit into the existing set of JSON functions
such as:
// applies a JSON Patch
json_patch_apply(json, patch)
// diffs two JSON objects and produces a JSON Patch
json_patch_diff(json a, json b)
Thanks,
Ryan Pedela
On 03/13/2014 09:53 AM, Ryan Pedela wrote:
This is my first email to the PostgreSQL mailing lists so I hope this is
the correct place. If not, please let me know.I was wondering if it would be possible and wise to support JSON Patch?
https://tools.ietf.org/html/rfc6902One of the problems I have as a user is how to update a portion of a JSON
object efficiently. Right now I have to read the entire field from the
database, update it, and then write it back. I am thinking JSON Patch might
be a good way to solve this problem because it would allow partial updates
and I think it could easily fit into the existing set of JSON functions
such as:// applies a JSON Patch
json_patch_apply(json, patch)// diffs two JSON objects and produces a JSON Patch
json_patch_diff(json a, json b)
I can't speak to the technical difficulties, but *I* would use it.
Note that on the backend Postgres is still going to re-write the entire
JSON value. Also, we'd want both a json_patch and jsonb_patch, which
would have the same syntax but different internal plumbing.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Import Notes
Reply to msg id not found: WMaeda5ebf7168a686c399370ce4d3f71e993e2c79713317d1641df215f3decaade0d4e94a7f72156529d2a9ce034206ef@asav-2.01.com
On 03/13/2014 01:01 PM, Josh Berkus wrote:
On 03/13/2014 09:53 AM, Ryan Pedela wrote:
This is my first email to the PostgreSQL mailing lists so I hope this is
the correct place. If not, please let me know.I was wondering if it would be possible and wise to support JSON Patch?
https://tools.ietf.org/html/rfc6902One of the problems I have as a user is how to update a portion of a JSON
object efficiently. Right now I have to read the entire field from the
database, update it, and then write it back. I am thinking JSON Patch might
be a good way to solve this problem because it would allow partial updates
and I think it could easily fit into the existing set of JSON functions
such as:// applies a JSON Patch
json_patch_apply(json, patch)// diffs two JSON objects and produces a JSON Patch
json_patch_diff(json a, json b)I can't speak to the technical difficulties, but *I* would use it.
Note that on the backend Postgres is still going to re-write the entire
JSON value. Also, we'd want both a json_patch and jsonb_patch, which
would have the same syntax but different internal plumbing.
Some of this will be less than trivial especially for text-format json.
But without committing myself I'll be interested to see a patch.
cheers
andrew
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers