Skip to content

Commit 3c61e03

Browse files
authored
fix for to_text only returning first element of array (#111)
1 parent ed77040 commit 3c61e03

File tree

6 files changed

+2831
-3
lines changed

6 files changed

+2831
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
## [v0.6.1]
3+
4+
### Fixed
5+
- Fix issue where using equality operator against an array was only comparing the first element of the array
6+
27
## [v0.6.0]
38

49
### Fixed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
SET SEARCH_PATH to pgstac, public;
2+
set check_function_bodies = off;
3+
4+
CREATE OR REPLACE FUNCTION pgstac.to_text(jsonb)
5+
RETURNS text
6+
LANGUAGE sql
7+
IMMUTABLE STRICT
8+
AS $function$
9+
SELECT CASE WHEN jsonb_typeof($1) IN ('array','object') THEN $1::text ELSE $1->>0 END;
10+
$function$
11+
;
12+
13+
14+
15+
SELECT set_version('0.6.1');

0 commit comments

Comments
 (0)