Make CSV column ordering a bit more logical.
This commit is contained in:
parent
1ebff9ba81
commit
230e8962f3
|
@ -1,4 +1,4 @@
|
||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.159 2007/12/11 15:19:05 alvherre Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.160 2007/12/11 20:07:31 alvherre Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime-config">
|
<chapter Id="runtime-config">
|
||||||
<title>Server Configuration</title>
|
<title>Server Configuration</title>
|
||||||
|
@ -3001,7 +3001,7 @@ local0.* /var/log/postgresql
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%l</literal></entry>
|
<entry><literal>%l</literal></entry>
|
||||||
<entry>Number of the log line for each process, starting at 1</entry>
|
<entry>Number of the log line for each session or process, starting at 1</entry>
|
||||||
<entry>no</entry>
|
<entry>no</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
@ -3167,7 +3167,7 @@ local0.* /var/log/postgresql
|
||||||
provides a convenient way to import log files into a database table.
|
provides a convenient way to import log files into a database table.
|
||||||
This option emits log lines in comma-separated-value format,
|
This option emits log lines in comma-separated-value format,
|
||||||
with these columns: timestamp with milliseconds, user name, database
|
with these columns: timestamp with milliseconds, user name, database
|
||||||
name, session ID, host:port number, process ID, per-process line
|
name, process ID, host:port number, session ID, per-session or -process line
|
||||||
number, command tag, session start time, virtual transaction ID,
|
number, command tag, session start time, virtual transaction ID,
|
||||||
regular transaction id, error severity, SQL state code, error message,
|
regular transaction id, error severity, SQL state code, error message,
|
||||||
error message detail, hint, internal query that led to the error (if
|
error message detail, hint, internal query that led to the error (if
|
||||||
|
@ -3181,13 +3181,13 @@ local0.* /var/log/postgresql
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE postgres_log
|
CREATE TABLE postgres_log
|
||||||
(
|
(
|
||||||
log_time timestamp with time zone,
|
log_time timestamp(3) with time zone,
|
||||||
user_name text,
|
user_name text,
|
||||||
database_name text,
|
database_name text,
|
||||||
session_id text,
|
|
||||||
connection_from text,
|
|
||||||
process_id integer,
|
process_id integer,
|
||||||
process_line_num bigint,
|
connection_from text,
|
||||||
|
session_id text,
|
||||||
|
session_line_num bigint,
|
||||||
command_tag text,
|
command_tag text,
|
||||||
session_start_time timestamp with time zone,
|
session_start_time timestamp with time zone,
|
||||||
virtual_transaction_id text,
|
virtual_transaction_id text,
|
||||||
|
@ -3203,7 +3203,7 @@ CREATE TABLE postgres_log
|
||||||
query text,
|
query text,
|
||||||
query_pos integer,
|
query_pos integer,
|
||||||
location text,
|
location text,
|
||||||
PRIMARY KEY (session_id, process_line_num)
|
PRIMARY KEY (session_id, session_line_num)
|
||||||
);
|
);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.199 2007/12/11 15:19:05 alvherre Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.200 2007/12/11 20:07:31 alvherre Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -1667,7 +1667,6 @@ write_csvlog(ErrorData *edata)
|
||||||
|
|
||||||
initStringInfo(&buf);
|
initStringInfo(&buf);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* timestamp with milliseconds
|
* timestamp with milliseconds
|
||||||
*
|
*
|
||||||
|
@ -1715,8 +1714,9 @@ write_csvlog(ErrorData *edata)
|
||||||
appendCSVLiteral(&buf, MyProcPort->database_name);
|
appendCSVLiteral(&buf, MyProcPort->database_name);
|
||||||
appendStringInfoChar(&buf, ',');
|
appendStringInfoChar(&buf, ',');
|
||||||
|
|
||||||
/* session id */
|
/* Process id */
|
||||||
appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
|
if (MyProcPid != 0)
|
||||||
|
appendStringInfo(&buf, "%d", MyProcPid);
|
||||||
appendStringInfoChar(&buf, ',');
|
appendStringInfoChar(&buf, ',');
|
||||||
|
|
||||||
/* Remote host and port */
|
/* Remote host and port */
|
||||||
|
@ -1730,9 +1730,8 @@ write_csvlog(ErrorData *edata)
|
||||||
}
|
}
|
||||||
appendStringInfoChar(&buf, ',');
|
appendStringInfoChar(&buf, ',');
|
||||||
|
|
||||||
/* Process id */
|
/* session id */
|
||||||
if (MyProcPid != 0)
|
appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
|
||||||
appendStringInfo(&buf, "%d", MyProcPid);
|
|
||||||
appendStringInfoChar(&buf, ',');
|
appendStringInfoChar(&buf, ',');
|
||||||
|
|
||||||
/* Line number */
|
/* Line number */
|
||||||
|
|
Loading…
Reference in New Issue