Index: doc/src/sgml/runtime.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v
retrieving revision 1.322
diff -c -c -r1.322 runtime.sgml
*** doc/src/sgml/runtime.sgml	4 Jun 2005 20:42:41 -0000	1.322
--- doc/src/sgml/runtime.sgml	9 Jun 2005 22:24:15 -0000
***************
*** 2830,2835 ****
--- 2830,2840 ----
               <entry>yes</entry>
              </row>
              <row>
+              <entry><literal>%h</literal></entry>
+              <entry>Remote Hostname or IP address</entry>
+              <entry>yes</entry>
+             </row>
+             <row>
               <entry><literal>%p</literal></entry>
               <entry>Process ID</entry>
               <entry>no</entry>
***************
*** 2840,2845 ****
--- 2845,2855 ----
               <entry>no</entry>
              </row>
              <row>
+              <entry><literal>%m</literal></entry>
+              <entry>Timestamp with milliseconds</entry>
+              <entry>no</entry>
+             </row>
+             <row>
               <entry><literal>%i</literal></entry>
               <entry>Command tag: This is the command that generated the log line.</entry>
               <entry>yes</entry>
Index: src/backend/utils/error/elog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/error/elog.c,v
retrieving revision 1.158
diff -c -c -r1.158 elog.c
*** src/backend/utils/error/elog.c	12 Mar 2005 01:54:44 -0000	1.158
--- src/backend/utils/error/elog.c	9 Jun 2005 22:24:17 -0000
***************
*** 1375,1380 ****
--- 1375,1407 ----
  			case 'l':
  				appendStringInfo(buf, "%ld", log_line_number);
  				break;
+ 			case 'm':
+ 				{
+ 					time_t stamp_time;
+ 					char strfbuf[128], msbuf[5];
+ 					struct timeval tv;
+ 
+ 					gettimeofday(&tv, NULL);
+  					stamp_time = tv.tv_sec;
+ 
+ 					strftime(strfbuf, sizeof(strfbuf),
+ 					/* leave room for milliseconds... */
+ 					/* Win32 timezone names are too long so don't print them. */
+ #ifndef WIN32
+ 						"%Y-%m-%d %H:%M:%S     %Z",
+ #else
+ 						"%Y-%m-%d %H:%M:%S     ",
+ #endif
+ 						localtime(&stamp_time));
+ 
+ 					/* 'paste' milliseconds into place... */
+  					sprintf(msbuf, ".%03d", 
+ 						(int)(tv.tv_usec/1000));
+ 					strncpy(strfbuf+19, msbuf, 4);
+ 
+ 					appendStringInfoString(buf, strfbuf);
+ 				}
+ 				break;
  			case 't':
  				{
  					/*
***************
*** 1426,1431 ****
--- 1453,1462 ----
  										 MyProcPort->remote_port);
  				}
  				break;
+ 			case 'h':
+ 				if (MyProcPort)
+ 					appendStringInfo(buf, "%s", MyProcPort->remote_host);
+ 				break;
  			case 'q':
  				/* in postmaster and friends, stop if %q is seen */
  				/* in a backend, just ignore */
Index: src/backend/utils/misc/postgresql.conf.sample
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/misc/postgresql.conf.sample,v
retrieving revision 1.143
diff -c -c -r1.143 postgresql.conf.sample
*** src/backend/utils/misc/postgresql.conf.sample	4 Jun 2005 20:42:42 -0000	1.143
--- src/backend/utils/misc/postgresql.conf.sample	9 Jun 2005 22:24:17 -0000
***************
*** 241,248 ****
  #log_duration = false
  #log_line_prefix = ''		# e.g. '<%u%%%d> ' 
  				# %u=user name %d=database name
! 				# %r=remote host and port
  				# %p=PID %t=timestamp %i=command tag
  				# %c=session id %l=session line number
  				# %s=session start timestamp %x=transaction id
  				# %q=stop here in non-session processes
--- 241,249 ----
  #log_duration = false
  #log_line_prefix = ''		# e.g. '<%u%%%d> ' 
  				# %u=user name %d=database name
! 				# %r=remote host and port %h=remote host
  				# %p=PID %t=timestamp %i=command tag
+ 				# %m=timestamp with milliseconds
  				# %c=session id %l=session line number
  				# %s=session start timestamp %x=transaction id
  				# %q=stop here in non-session processes
