主要需要修改的参数如下,参数修改完毕后重启服务,重新连接数据库,对其操作即可查看日志变化情况.
专注于为中小企业提供成都做网站、网站设计服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业恩施土家免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了成百上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
# - When to Log -
client_min_messages = info
#client_min_messages = notice # values in order of decreasing
detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
log_min_messages = info
#log_min_messages = warning # values in order of decreasing
detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
log_min_error_statement = info
#log_min_error_statement = error # values in order of decreasing
detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all
statements
# and their durations, 0
logs only
# statements running at least
this number
# of milliseconds
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = on
log_disconnections = on
#log_duration = off
log_error_verbosity = verbose # terse, default, or verbose
messages
#log_hostname = off
log_line_prefix = '%a %u %d %h %t %i %e ' # special
values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and
port(this is a os port)
# %h = remote host
# %p = process ID
# %t = timestamp without
milliseconds
# %m = timestamp with
milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start
timestamp
# %v = virtual transaction
ID
# %x = transaction ID (0 if
none)
# %q = stop here in
non-session
# processes
# %% = '%'
# e.g. ' '
#log_lock_waits = off # log lock waits =
deadlock_timeout
log_statement = 'all' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or
larger
# than the specified size in
kilobytes;
# -1 disables, 0 logs all temp
files
log_timezone = 'Asia/Hong_Kong'
如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】
希望我的回答对您有所帮助,望采纳!
在安装Postgresql后,有天突然发现C盘空间变小,就逐个排查,最后发现Postgresql文件占了10多G,再进去data目录,发现最大的是pg_log目录,占的空间差不多10G。打开一看,是记录其每天的运行日志目录,差不多2000个文件,每个文件几十M。
经了解,这是由于其没有重用日志文件造成的,故可以通过设置postgresql.conf文件,修改log_truncate_on_rotation选项为on,即可重用同名日志文件,在其末尾添加新的日志信息。
1、通过命令行查询
\d 数据库 —— 得到所有表的名字
\d 表名 —— 得到表结构
2、通过SQL语句查询
"select * from pg_tables" —— 得到当前db中所有表的信息(这里pg_tables是系统视图)
"select tablename from pg_tables where schemaname='public'" —— 得到所有用户自定义表的名字(这里"tablename"字段是表的名字,"schemaname"是schema的名字。用户自定义的表,如果未经特殊处理,默认都是放在名为public的schema下)
那说明安装文件本身就是有问题的 也有可能是某些部分不支持中文目录 你可以改成英文目录再试试,如果 仍有这样的问题,那说明安装包 制作的时候就有问题了