Browse Source

Merge pull request #8 from seriyps/varchar-array

Varchar array
David N. Welton 11 years ago
parent
commit
f67465f6e4
2 changed files with 3 additions and 0 deletions
  1. 2 0
      src/pgsql_types.erl
  2. 1 0
      test/pgsql_tests.erl

+ 2 - 0
src/pgsql_types.erl

@@ -44,6 +44,7 @@ oid2type(1005) -> {array, int2};
 oid2type(1007) -> {array, int4};
 oid2type(1009) -> {array, text};
 oid2type(1014) -> {array, char};
+oid2type(1015) -> {array, varchar};
 oid2type(1016) -> {array, int8};
 oid2type(1021) -> {array, float4};
 oid2type(1022) -> {array, float8};
@@ -136,6 +137,7 @@ type2oid({array, int2})         -> 1005;
 type2oid({array, int4})         -> 1007;
 type2oid({array, text})         -> 1009;
 type2oid({array, char})         -> 1014;
+type2oid({array, varchar})      -> 1015;
 type2oid({array, int8})         -> 1016;
 type2oid({array, float4})       -> 1021;
 type2oid({array, float8})       -> 1022;

+ 1 - 0
test/pgsql_tests.erl

@@ -569,6 +569,7 @@ array_type_test(Module) ->
           Select(int4,   [[1, 2]]),
           Select(int8,   [[[[1, 2]], [[3, 4]]]]),
           Select(text,   [<<"one">>, <<"two>">>]),
+          Select(varchar,   [<<"one">>, <<"two>">>]),
           Select(float4, [0.0, 1.0, 0.123]),
           Select(float8, [0.0, 1.0, 0.123]),
           Select(date, [{2008,1,2}, {2008,1,3}]),