3 ms·
I have used its JSON features for real-world stuff and loved it. I have stored procedures doing a bunch of stuff and returning a nicely formatted JSON object t
by borplk 9y ago
I have used its JSON features for real-world stuff and loved it.
I have stored procedures doing a bunch of stuff and returning a nicely formatted JSON object that makes the job of the application code a lot easier.
One thing I dislike is that the friction for initial development and prototyping is a little too high.
You have to have scripts lying around to re-create the functions when you change it during dev.
And logging/debugging/etc is harder and not as flexible.
- haasted 9y agoHow close does it come to document databases when it comes to changing the JSON? Is it easy to increment a field, for example? Or add a property to an object?
- e1g 9y agoPG JSON implementation is solid and supports nearly everything you want from a document database, with the added bonus of joins, queries, ACID, and tooling. However, syntax can be awkward at times - # Find a row by JSON property value select * from person where details->>'name' ilike '%james%' # check for property existence select * from person where details ? 'is_hidden' # Override a single property in a JSON field - update person set details = details || '{"phone":"911"}' # Alt increment existing value update person set details = jsonb_set(details, '{views}', (details->'views')+1) More examples at https://www.postgresql.org/docs/current/static/functions-json.html https://www.postgresql.org/docs/current/static/functions-jso...