Nathan Bossart <nathandbossart@gmail.com> writes:
> I don't think we want to teach appendPGArray() to handle single quotes.
No, that seems quite wrong. array_in won't de-dup single quotes.
> My first instinct is that we need to build the array with appendPGArray()
> and then append it to the query using appendStringLiteralAH(), as done in
> the attached patch.
Yeah, I think so. I was confused for a bit because the one extant
user of appendPGArray is getNamespaces which does an additional layer
of quote-doubling via quoteAclUserName. However, that seems to be because
it's trying to build aclitem[] arrays whose elements will be read by
aclitemin, and that de-dups double quotes.
Wouldn't be a bad idea to add a test case.
regards, tom lane