title: Is jsonb conversion to text deterministic?
body: <p>This is the short version of an overly long <a href="https://stackoverflow.com/questions/58487208/efficiently-group-many-fields-including-large-text-and-jsonb">question</a> that sadly attracted no answers.</p>
  
  <p>Is it possible, given two jsonb variables x and y, to have both<br>
   1. (x = y) yield true, and<br>
   2. (x::text = y::text) yield false</p>
  
  <p>I ask this question because it appears there is no promised order in which a jsonb object will be unpacked into a string. I'd just like to be sure this is the case.</p>
  
  <p>Thanks in advance for feedback!</p>
  
  <p>Edit:</p>
  
  <p>The original question covers the "why" for this question, but the skinny is that I hope to group data in different rows based upon a hash of many columns represented as text, some of which are jsonb.</p>
  
  <p>I don't care which way the object comes in or which way it gets unpacked, but I do care if two jsonb fields which are equivalent as jsonb are not equivalent as text strings.</p>
  
  <p>As it <em>seems</em> I cannot count on text representations to be presented in the same way, I've normalized out the jsonb field to a separate table with the jsonb field set as a unique index.</p>
  
  <p>And if I write more here... this question will approach the length of the one it derives from!</p>