pg_json 0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/pg_json +8 -6
- metadata +1 -1
data/bin/pg_json
CHANGED
@@ -64,12 +64,14 @@ declare
|
|
64
64
|
begin
|
65
65
|
res = '[';
|
66
66
|
if data is not null then
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
67
|
+
if array_upper(data,1) is not null then
|
68
|
+
for i in 1..array_upper(data,1) loop
|
69
|
+
res = res || to_json(data[i]);
|
70
|
+
if i < array_upper(data,1) then
|
71
|
+
res = res || ',';
|
72
|
+
end if;
|
73
|
+
end loop;
|
74
|
+
end if;
|
73
75
|
end if;
|
74
76
|
res = res || ']';
|
75
77
|
return res;
|