Jim Nasby <jim.na...@bluetreble.com> writes: > regrole and regnamespace don't run their output through quote_ident(). > That's contrary to all the other reg* operators. > Worse, they also don't *allow* quoted input. Not only is that different > from reg*, it's the *opposite*:
BTW, there's a concrete reason why this is broken, which is that although regrole and regnamespace didn't bother with copying quoting/dequoting from the other types, they *did* copy the special case logic about allowing and emitting numeric OIDs. This means that an output like "1234" from regroleout is formally inconsistent: there is no way to tell if it's an numeric OID or a role name that happens to be all digits. (With proper quoting logic, you could tell because an all-digits role name would have gotten quoted.) Conversely, if you create an all-digits role name, there is no way to get regrolein to interpret it as such, whereas a dequoting rule would have disambiguated. I'm inclined to leave to_regrole and to_regnamespace alone, though, since they have no numeric-OID path, and they will provide an "out" for anyone who wants to handle nonquoted names. (Though at least in HEAD we ought to fix them to take type text as input. Using cstring for ordinary functions is just sloppy.) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers