diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 846c90c7ae4..a81218fe222 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -2062,7 +2062,16 @@ funcname_signature_string(const char *funcname, int nargs, initStringInfo(&argbuf); - if (sql_dialect == SQL_DIALECT_TSQL && remove_db_name_in_schema_hook) { + /* Check if there is schema in funcname */ + char * ptr = funcname; + while (ptr) { + if (*ptr == '.') { + break; + } + ptr++; + } + + if (sql_dialect == SQL_DIALECT_TSQL && remove_db_name_in_schema_hook && ptr) { funcname = (*remove_db_name_in_schema_hook)(funcname); }