1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add virtual transaction IDs to CSVLOG output, so that messages coming from

the same transaction can be identified even when no regular XID was assigned.
This seems essential after addition of the lazy-XID patch.  Also some
minor code cleanup in write_csvlog().
This commit is contained in:
Tom Lane
2007-09-27 18:15:36 +00:00
parent a62a359ba2
commit 77c166ba6c
2 changed files with 25 additions and 34 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.148 2007/09/26 22:36:30 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.149 2007/09/27 18:15:36 tgl Exp $ -->
<chapter Id="runtime-config">
<title>Server Configuration</title>
@ -3123,8 +3123,8 @@ SELECT * FROM parent WHERE key = 2400;
This option emits log lines in comma-separated-value format,
with these columns: timestamp with milliseconds, username, database
name, session id, host:port number, process id, per-process line
number, command tag, session start time, transaction id, error
severity, SQL state code, statement/error message.
number, command tag, session start time, virtual transaction id,
regular transaction id, error severity, SQL state code, error message.
Here is a sample table definition for storing CSV-format log output:
</para>
@ -3132,23 +3132,23 @@ SELECT * FROM parent WHERE key = 2400;
CREATE TABLE postgres_log
(
log_time timestamp with time zone,
username text,
user_name text,
database_name text,
sessionid text,
session_id text,
connection_from text,
process_id integer,
process_line_num bigint,
command_tag text,
session_start_time timestamp with time zone,
virtual_transaction_id text,
transaction_id bigint,
error_severity text,
sql_state_code text,
statement text,
PRIMARY KEY (sessionid, process_line_num)
message text,
PRIMARY KEY (session_id, process_line_num)
);
</programlisting>
<para>
To import a log file into this table, use the <command>COPY FROM</>
command: