array problem with double quotes

From: Olivier Leprêtre <o(dot)lepretre(at)gmail(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: array problem with double quotes
Date: 2018-10-14 13:40:33
Message-ID: 5bc34756.1c69fb81.22161.822d@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Is there a way to create arrays without postgres adding double quotes when
there are commas ?

select v1,v2 from (values ('co',array[['ab'],['ab,da']])) sub (v1,v2)

returns

"v1";"v2"

"co";"{{ab},{"ab,da"}}"

where I wanted

"co";"{{ab},{ab,da}}"

to match with the result of an array_agg which returns {ab,da}

In my case I then can't have {ab,da} @> {"ab,da"}

Thanks,

Olivier

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2018-10-16 12:36:44 Re: array problem with double quotes
Previous Message Stephen Frost 2018-10-11 01:56:23 Re: remove from list?