File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1642,12 +1642,18 @@ regroleout(PG_FUNCTION_ARGS)
16421642
16431643 result = GetUserNameFromId (roleoid , true);
16441644
1645- if (!result )
1645+ if (result )
1646+ {
1647+ /* pstrdup is not really necessary, but it avoids a compiler warning */
1648+ result = pstrdup (quote_identifier (result ));
1649+ }
1650+ else
16461651 {
16471652 /* If OID doesn't match any role, return it numerically */
16481653 result = (char * ) palloc (NAMEDATALEN );
16491654 snprintf (result , NAMEDATALEN , "%u" , roleoid );
16501655 }
1656+
16511657 PG_RETURN_CSTRING (result );
16521658}
16531659
@@ -1757,12 +1763,18 @@ regnamespaceout(PG_FUNCTION_ARGS)
17571763
17581764 result = get_namespace_name (nspid );
17591765
1760- if (!result )
1766+ if (result )
1767+ {
1768+ /* pstrdup is not really necessary, but it avoids a compiler warning */
1769+ result = pstrdup (quote_identifier (result ));
1770+ }
1771+ else
17611772 {
17621773 /* If OID doesn't match any namespace, return it numerically */
17631774 result = (char * ) palloc (NAMEDATALEN );
17641775 snprintf (result , NAMEDATALEN , "%u" , nspid );
17651776 }
1777+
17661778 PG_RETURN_CSTRING (result );
17671779}
17681780
You can’t perform that action at this time.
0 commit comments