Not to complain, but it seems the Web has become a huge spam bucket with useful nuggets few and far between. I have seen such articles a gazillion times till now. An article that talks about a subject, very very superficially, includes an obvious example, and concludes with a generic statement. Maybe the "users are the content creators" is not such a good idea after all.
Using PostgreSQL for JSON Storage
21–29 of 29 posts
Re: Using PostgreSQL for JSON Storage
#22I use JSONB heavily in a large application in production for many years. A few things to be careful of: Unbounded Data this will have performance problems for your data set as the size of your table grows. One single value in one row that is 8MB of JSON will bring down the performance of an entire collection. which leads to Schema keep your documents structured and validate them before they touch the database. At lea…
Re: Using PostgreSQL for JSON Storage
#23Earlier quoted context omitted.
I don't disagree that this article isn't news to anyone following Postgres and having used it. Yet I also have a conversation with someone about once a week that has no idea Postgres has any form of JSON support much less whats possible with it. There are a lot more beginners out there in the world and this type of content is useful to them. A deep dive of how GIN indexing works for JSON might be a useful nugget for…
I understand your point. But my contention is that there is a lot of spam, especially in the beginner content. So much so that real useful information is nowhere to be found in search engines. I have recently started learning React and when I search for a topic, I have to wade through a myriad of articles that are basically "Get Node, Get React, CRA new, etc. etc." Nothing of actual use, but search engines pick up be…
There is definitely some value in filling the gap between a hello world of JSON and exactly how to use a specific operator. I was gonna follow up with if there are any specific things that you might find useful on the Postgres arena would be happy to start personally writing a few, but for yourself sounds like docs are good enough :)
Re: Using PostgreSQL for JSON Storage
#24Earlier quoted context omitted.
I understand your point. But my contention is that there is a lot of spam, especially in the beginner content. So much so that real useful information is nowhere to be found in search engines. I have recently started learning React and when I search for a topic, I have to wade through a myriad of articles that are basically "Get Node, Get React, CRA new, etc. etc." Nothing of actual use, but search engines pick up be…
I hear you on value of articles diving deeper. The Postgres docs are awesome, but I find them most valuable as reference docs once you already know how to do something. I find if you're trying to learn how to do a new thing they're not quite as useful. There is definitely some value in filling the gap between a hello world of JSON and exactly how to use a specific operator. I was gonna follow up with if there are any…
I love the PGSQL docs. And I usually experiment my way through the docs, as most of the time, I am usually solving a problem and will learn a bit of the underlying mechanism, quirks and tips for performance before going ahead with a method.
For those, I find those docs more than sufficient.
I found the same with Django docs too.
The worst offender is NodeJS, and to a lesser extent, React.
Edit : If only there was a method to allow users to annotate comments onto the core docs, and there was a way to upvote / downvote the comments, we could have better documentation.
I have seen primitive versions of such mechanisms in PHP docs.
Re: Using PostgreSQL for JSON Storage
#25Not to complain, but it seems the Web has become a huge spam bucket with useful nuggets few and far between. I have seen such articles a gazillion times till now. An article that talks about a subject, very very superficially, includes an obvious example, and concludes with a generic statement. Maybe the "users are the content creators" is not such a good idea after all.
Re: Using PostgreSQL for JSON Storage
#26> Let's get the users last name. SELECT json_content ##> {person, last_name} FROM mytable; > The #> or #> is the JSON path navigator with the difference being #> returns JSON and the ##> returns the JSON text value. That should be #>> (two ">"), not ##> (two "#"). The official docs are really good and they include a number of inline examples showing the difference between the operators: https://www.postgresql.org/doc…
I guess PostgreSQL doesn't do everything for me :D Thanks for catching those and I will be updating the post soon. Did you get a chance to try the hands on exercise?
Re: Using PostgreSQL for JSON Storage
#27Earlier quoted context omitted.
I don't like those seemingly arbitrary json operators. ->> #>> ?& @>. IMHO, they'd be easier to understand with proper function names.
They’d have to invent a syntax for infix function calls akin to Haskell’s backticks which other people would complain about. (I’m happy we don’t have to write queries in yaml, only half joking.)
https://www.sqlite.org/json1.html
https://dev.mysql.com/doc/refman/8.0/en/json-function-refere...
https://docs.microsoft.com/en-us/sql/t-sql/functions/json-fu...
(Too bad there was no standard for these.)
Re: Using PostgreSQL for JSON Storage
#28Earlier quoted context omitted.
I don't like those seemingly arbitrary json operators. ->> #>> ?& @>. IMHO, they'd be easier to understand with proper function names.
They’d have to invent a syntax for infix function calls akin to Haskell’s backticks which other people would complain about. (I’m happy we don’t have to write queries in yaml, only half joking.)
Re: Using PostgreSQL for JSON Storage
#29Earlier quoted context omitted.
They’d have to invent a syntax for infix function calls akin to Haskell’s backticks which other people would complain about. (I’m happy we don’t have to write queries in yaml, only half joking.)
Other popular databases have named functions for this: https://www.sqlite.org/json1.html https://dev.mysql.com/doc/refman/8.0/en/json-function-refere... https://docs.microsoft.com/en-us/sql/t-sql/functions/json-fu... (Too bad there was no standard for these.)