A read against a key that is not there returns NULL. Nothing fails.
The common read: The extraction operators validate the request against the document, so asking for a key the document does not have fails loudly enough that I would know.
Name the error Postgres raises when you ask a document for a key it has never held, and then read the next sentence. There is none. The extraction operators are documented to return NULL rather than failing when the input "does not have the right structure to match the request; for example if no such key or array element exists".
Read a key the document never had and Postgres
The two extraction operators differ in what they hand you, not in how forgiving they are. -> returns jsonb, so a string leaf keeps its JSON quotes. ->> returns text, ready to compare against a text column, which is why almost every extraction written in anger is a ->>. That cast is where four situations stop being four. The warranty desk's report reads payload ->> 'extended_cover' for every row, and the audit of who was owed a payout lands eleven months later, filed against the report.
