aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-10-19 22:44:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-10-19 22:44:11 +0000
commit1b84441a4912cd8179e1aa5761729062a19686b1 (patch)
tree49498f07955664c90a709a61d6fb33ca9ffa7433 /src
parent4887f5f979f36a5d389e898edca61bd6aa4f0f20 (diff)
downloadpostgresql-1b84441a4912cd8179e1aa5761729062a19686b1.tar.gz
postgresql-1b84441a4912cd8179e1aa5761729062a19686b1.zip
Marginal improvement in logging: include the function name when logging
a fastpath function call.
Diffstat (limited to 'src')
-rw-r--r--src/backend/tcop/fastpath.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index 8a9d51a5516..7bd91eee074 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.93 2006/10/04 00:29:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.94 2006/10/19 22:44:11 tgl Exp $
*
* NOTES
* This cruft is the server side of PQfn.
@@ -51,6 +51,7 @@ struct fp_info
Oid namespace; /* other stuff from pg_proc */
Oid rettype;
Oid argtypes[FUNC_MAX_ARGS];
+ char fname[NAMEDATALEN]; /* function name for logging */
};
@@ -229,6 +230,7 @@ fetch_fp_info(Oid func_id, struct fp_info * fip)
fip->namespace = pp->pronamespace;
fip->rettype = pp->prorettype;
memcpy(fip->argtypes, pp->proargtypes.values, pp->pronargs * sizeof(Oid));
+ strlcpy(fip->fname, NameStr(pp->proname), NAMEDATALEN);
ReleaseSysCache(func_htp);
@@ -316,15 +318,6 @@ HandleFunctionRequest(StringInfo msgBuf)
fid = (Oid) pq_getmsgint(msgBuf, 4); /* function oid */
- /* Log as soon as we have the function OID */
- if (log_statement == LOGSTMT_ALL)
- {
- ereport(LOG,
- (errmsg("fastpath function call: function OID %u",
- fid)));
- was_logged = true;
- }
-
/*
* There used to be a lame attempt at caching lookup info here. Now we
* just do the lookups on every call.
@@ -332,6 +325,15 @@ HandleFunctionRequest(StringInfo msgBuf)
fip = &my_fp;
fetch_fp_info(fid, fip);
+ /* Log as soon as we have the function OID and name */
+ if (log_statement == LOGSTMT_ALL)
+ {
+ ereport(LOG,
+ (errmsg("fastpath function call: \"%s\" (OID %u)",
+ fip->fname, fid)));
+ was_logged = true;
+ }
+
/*
* Check permission to access and call function. Since we didn't go
* through a normal name lookup, we need to check schema usage too.
@@ -404,8 +406,8 @@ HandleFunctionRequest(StringInfo msgBuf)
break;
case 2:
ereport(LOG,
- (errmsg("duration: %s ms fastpath function call: function OID %u",
- msec_str, fid)));
+ (errmsg("duration: %s ms fastpath function call: \"%s\" (OID %u)",
+ msec_str, fip->fname, fid)));
break;
}