denodrivers / postgres

PostgreSQL driver for Deno

Home Page:https://denodrivers.github.io/postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array parsing is broken with varchar array containing a separator

TriForMine opened this issue · comments

Apparently when you have a varchar array: varchar(255) [], and that a value of that array contains a comma or semilicon.
Inserting works perfectly fine, but when you want to SELECT those values, data will be incorrectly splitted.

Examples:
1.

SELECT ARRAY['Test;Azer', '123;456']::VARCHAR[]

Will return

["Test", "Azer,123", "456"]
SELECT ARRAY['Fate;Grand Order CMs', 'FateGrand; Carnival']::VARCHAR[]

Will return

[ "Fate;Grand Order CMs", ",FateGrand; Carnival" ]
SELECT ARRAY['Fate/Grand Order Divine Realm of the Round Table: Camelot - Wandering; Agateram', 'Fate/Grand Order']::VARCHAR[]

Will return

["Fate/Grand Order Divine Realm of the Round Table: Camelot - Wandering; Agateram",",Fate/Grand Order"]