BUG #3799: csvlog skips some logs

From: "depesz" <depesz(at)depesz(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3799: csvlog skips some logs
Date: 2007-12-05 20:34:49
Message-ID: 200712052034.lB5KYnB8062975@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 3799
Logged by: depesz
Email address: depesz(at)depesz(dot)com
PostgreSQL version: 8.3 HEAD
Operating system: linux, 32bit
Description: csvlog skips some logs
Details:

when settings are set to:
# select name, setting, unit from pg_settings where name ilike 'log%' order
by name;
name | setting | unit
-----------------------------+--------------------------------+--------
log_autovacuum_min_duration | 0 | ms
log_checkpoints | on | [null]
log_connections | on | [null]
log_destination | stderr | [null]
log_directory | pg_log | [null]
log_disconnections | off | [null]
log_duration | off | [null]
log_error_verbosity | default | [null]
log_executor_stats | off | [null]
log_filename | postgresql-%Y-%m-%d_%H%M%S.log | [null]
logging_collector | on | [null]
log_hostname | off | [null]
log_line_prefix | [%t] [%p] <%u(at)%d> | [null]
log_lock_waits | off | [null]
log_min_duration_statement | 0 | ms
log_min_error_statement | error | [null]
log_min_messages | notice | [null]
log_parser_stats | off | [null]
log_planner_stats | off | [null]
log_rotation_age | 1440 | min
log_rotation_size | 102400 | kB
log_statement | none | [null]
log_statement_stats | off | [null]
log_temp_files | -1 | kB
log_timezone | Poland | [null]
log_truncate_on_rotation | off | [null]
(26 rows)

running faulty query in psql gives this output:
# select * from (select * from test);
ERROR: subquery in FROM must have an alias
HINT: For example, FROM (SELECT ...) [AS] foo.

and this is logged to logfile:
[2007-12-05 21:29:27 CET] [23689] <depesz(at)depesz> ERROR: subquery in FROM
must have an alias
[2007-12-05 21:29:27 CET] [23689] <depesz(at)depesz> HINT: For example, FROM
(SELECT ...) [AS] foo.
[2007-12-05 21:29:27 CET] [23689] <depesz(at)depesz> STATEMENT: select * from
(select * from test);

but when i change settings to:
# select name, setting, unit from pg_settings where name ilike 'log%' order
by name;
name | setting | unit
-----------------------------+--------------------------------+--------
log_autovacuum_min_duration | 0 | ms
log_checkpoints | on | [null]
log_connections | on | [null]
log_destination | csvlog | [null]
log_directory | pg_log | [null]
log_disconnections | off | [null]
log_duration | off | [null]
log_error_verbosity | default | [null]
log_executor_stats | off | [null]
log_filename | postgresql-%Y-%m-%d_%H%M%S.log | [null]
logging_collector | on | [null]
log_hostname | off | [null]
log_line_prefix | [%t] [%p] <%u(at)%d> | [null]
log_lock_waits | off | [null]
log_min_duration_statement | 0 | ms
log_min_error_statement | error | [null]
log_min_messages | notice | [null]
log_parser_stats | off | [null]
log_planner_stats | off | [null]
log_rotation_age | 1440 | min
log_rotation_size | 102400 | kB
log_statement | none | [null]
log_statement_stats | off | [null]
log_temp_files | -1 | kB
log_timezone | Poland | [null]
log_truncate_on_rotation | off | [null]
(26 rows)
(only log_destination changed), and issue the same query only this gets
logged:

2007-12-05 21:30:42.148
CET,"depesz","depesz",47570a4e.5cfb,[local],23803,5,"idle",2007-12-05
21:30:06 CET,1/4,0,ERROR,42601,"subquery in FROM must have an alias"

output on console is the same:
# select * from (select * from test);
ERROR: subquery in FROM must have an alias
HINT: For example, FROM (SELECT ...) [AS] foo.

documentation doesn't inform about this kind of change (i.e. skiping parts
of logs), so it looks like a bug.

depesz

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Han 2007-12-05 23:52:05 BUG #3800: Java/Postgres PreparedStatement returns stale data
Previous Message Tom Lane 2007-12-05 03:07:44 Re: BUG #3790: pg_restore error canceling statement due touser request

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2007-12-05 20:36:59 Re: Open items for 8.3
Previous Message Andrew Dunstan 2007-12-05 20:27:49 Re: buildenv.pl/buildenv.bat