Closed shane-circuithub closed 1 year ago
@ocharles I'm tempted just to merge this now and revisit #242 if someone ever comes along wanting to do triple-nested catListTable
, and just hope that Postgres gets better support for anonymous records (or nested 1D arrays!) in the mean time.
This is another possible "fix" to #168 (as opposed to #242). It doesn't really fix the problem, but it allows us to use two levels of
catListTable
instead of only one. Instead of trying to use Postgres's broken.f1
syntax, we cast the anonymous record to text, remove the parentheses and quotes and unescape any escaped quotes or backslashes, and then cast the resulting text back to the appropriate type. The reason this only works one level deep is that if the type we cast the text back to is itself an anonymous record, then PostgreSQL doesn't know how to parse the text.It's kind of ugly and hacky but it does work and otherwise maintains the status quo. Comparison operators on nested lists continue to work as before and we don't need to burden
DBType
with parsing nonsense.