1

Is there a way to make postgres escape all the values in the response to a query?

Especially for cases like ({xx(yy)zz}) (a text value in an array field of a composite type) which would escape as ({"xx(yy)zz"}) (or something like that).

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
kag0
  • 5,624
  • 7
  • 34
  • 67
  • Escape for what? What result would you expect for that text in an array in a composite type? What system is going to parse the output? – Bergi Dec 09 '21 at 01:23
  • I'm trying to work around and/or fix a bug in slick-pg specifically. – kag0 Dec 09 '21 at 02:13
  • As a workaround, just don't query composite types as a single result column. Query their individual fields instead. – Bergi Dec 09 '21 at 02:18
  • querying the column with `to_json` is a better work around imo, since it retains the structure of the composite type. but really getting postgres to escape things would be best. – kag0 Dec 09 '21 at 17:23
  • Can you show the code that is parsing the value? Fixing that would be best. – Bergi Dec 09 '21 at 17:44
  • join the party https://github.com/tminglei/slick-pg/pull/511 – kag0 Dec 09 '21 at 17:45

0 Answers0