BEGIN; CREATE EXTENSION pair; SELECT pair('foo', 'bar') , pair('HEY'::text, 'bar') , pair('foo'::text, 'woah'::text) , pair('ick', 'foo'::text) , pair('foo'::text, 1) , pair(12.3, 'foo'::text) , pair(1, 12) ; pair | pair | pair | pair | pair | pair | pair -----------+-----------+------------+-----------+---------+------------+-------- (foo,bar) | (HEY,bar) | (foo,woah) | (ick,foo) | (foo,1) | (12.3,foo) | (1,12) (1 row) SELECT 'foo' ~> 'bar' AS arrowop , 'HEY'::text ~> 'bar' , 'foo'::text ~> 'woah'::text , 'ick' ~> 'foo'::text , 'foo'::text ~> 1 , 12.3 ~> 'foo'::text , 1 ~> 12 ; arrowop | ?column? | ?column? | ?column? | ?column? | ?column? | ?column? -----------+-----------+------------+-----------+----------+------------+---------- (foo,bar) | (HEY,bar) | (foo,woah) | (ick,foo) | (foo,1) | (12.3,foo) | (1,12) (1 row) CREATE TABLE kv ( pair pair ); INSERT INTO kv VALUES('foo' ~> 'bar'), (1 ~> 2); SELECT (pair).k, (pair).v FROM kv ORDER BY (pair).k; k | v -----+----- 1 | 2 foo | bar (2 rows) SELECT (pair('foo', 'bar')).k; k ----- foo (1 row) SELECT (pair('foo', 'bar')).v; v ----- bar (1 row) SELECT ('foo' ~> 'bar').k; k ----- foo (1 row) SELECT ('foo' ~> 'bar').v; v ----- bar (1 row) ROLLBACK;