pickle.sql 544 B

12345678910111213
  1. /* postgres can not */
  2. /* syntax version 1 */
  3. $lst = AsList(AsTuple(13,4),AsTuple(11,2),AsTuple(17,8),AsTuple(5,6));
  4. $p1 = Pickle(ToDict($lst));
  5. $p2 = StablePickle(ToDict($lst));
  6. $p3 = StablePickle(ToSortedDict($lst));
  7. $p4 = Pickle(ToDict(ListReverse($lst)));
  8. $p5 = StablePickle(ToDict(ListReverse($lst)));
  9. select $p1, Ensure($p2, $p1 != $p2), Ensure($p3, $p2 = $p3),
  10. Ensure($p4, $p4 != $p1), Ensure($p5, $p5 = $p2);
  11. select ListSort(DictItems(Unpickle(TypeOf(ToDict($lst)),$p1))), ListSort(DictItems(Unpickle(TypeOf(ToDict($lst)),$p2)));