On Wed, Nov 20, 2013 at 9:53 PM, Christopher Browne <cbbro...@gmail.com> wrote:
> Wait, that doesn't work if more than one role is added, as they get
> merged together by the quoting.
> A somewhat ugly amount of quoting can be done at the shell level to
> induce double quotes.
> $ createuser -g "\"test_rol'e_3\"" usequoted3
> I note that similar (with not quite identical behaviour) issues apply
> to the user name.  Perhaps the
> resolution to this is to leave quoting issues to the administrator.
> That simplifies the problem away.

We are already doing something similar for username, refer below line:
printfPQExpBuffer(&sql, "CREATE ROLE %s", fmtId(newuser));

Here fmtId() is doing handling for quotes. Now for new syntax IN ROLE,
the difference is that it can have multiple strings which needs
additional handling. I think some similar handling should be there in
server, pg_dump as well.

> I suspect that the apparatus needed to do a thorough solution (e.g. -
> parse the string, and do something
> "smarter") may be larger than is worth getting into.

I think if it needs some bigger solution then we can leave it by
having small note in documentation, but if it's just a matter of
calling some existing functions or mimic some handling done at other
place, then it is worth trying.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to