From 05fc744b967d15fa07c484ad87dd8cc943ad839f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 24 Mar 2008 18:08:47 +0000 Subject: Add a new ereport auxiliary function errdetail_log(), which works the same as errdetail except the string goes only to the server log, replacing the normal errdetail there. This provides a reasonably clean way of dealing with error details that are too security-sensitive or too bulky to send to the client. This commit just adds the infrastructure --- actual uses to follow. --- src/include/utils/elog.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 78939baa898..3b980cae79a 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.91 2008/03/10 12:55:13 mha Exp $ + * $PostgreSQL: pgsql/src/include/utils/elog.h,v 1.92 2008/03/24 18:08:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -125,6 +125,12 @@ errdetail(const char *fmt,...) the supplied arguments. */ __attribute__((format(printf, 1, 2))); +extern int +errdetail_log(const char *fmt,...) +/* This extension allows gcc to check the format string for consistency with + the supplied arguments. */ +__attribute__((format(printf, 1, 2))); + extern int errhint(const char *fmt,...) /* This extension allows gcc to check the format string for consistency with @@ -258,6 +264,7 @@ typedef struct ErrorData int sqlerrcode; /* encoded ERRSTATE */ char *message; /* primary error message */ char *detail; /* detail error message */ + char *detail_log; /* detail error message for server log only */ char *hint; /* hint message */ char *context; /* context message */ int cursorpos; /* cursor index into query string */ -- cgit v1.2.3