4 #include <libpq/libpq-be.h>
7 PG_FUNCTION_INFO_V1(logmsg);
8 Datum logmsg(PG_FUNCTION_ARGS) {
13 arg0 = PG_GETARG_TEXT_P(0);
14 len = arg0->vl_len - VARHDRSZ;
16 msg = (char*) palloc(len+1);
17 memcpy(msg, arg0->vl_dat, len);
20 openlog("postgres", LOG_PID, LOG_LOCAL6);
21 syslog(LOG_INFO, "[%s]: %s", GetUserNameFromId(GetUserId()), msg);