This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Tie::IxHash; | |
use JSON; | |
use Data::Dump qw/dump/; | |
my $json = '{"test":"test","test2":"test2","test4":"test4","test3":"test3"}'; | |
my $obj_parser_sub = \&JSON::PP::object; | |
*JSON::PP::object = sub { | |
tie my %obj, 'Tie::IxHash'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -rupN hstore/hstore--1.1.sql hstore_hstore_to_json/hstore--1.1.sql | |
--- hstore/hstore--1.1.sql 2013-02-05 06:28:13.000000000 +0900 | |
+++ hstore_hstore_to_json/hstore--1.1.sql 2013-04-04 10:53:53.000000000 +0900 | |
@@ -234,6 +234,19 @@ LANGUAGE C IMMUTABLE STRICT; | |
CREATE CAST (text[] AS hstore) | |
WITH FUNCTION hstore(text[]); | |
+CREATE FUNCTION hstore_to_json(hstore) | |
+RETURNS json | |
+AS 'MODULE_PATHNAME', 'hstore_to_json' |