> Updated patch attached.
I think we need to improve postgresql.conf.sample a bit more, especially
the long line for #log_csv_fields = '...'. 330 characters in it! #1. Leave the long line because it is needed. #2. Hide
thevariable from the default conf. #3. Use short %x mnemonic both in log_line_prefix and log_csv_fields. (It might
requiremany additional mnemonics.)
Which is better, or another idea?
On Sat, Jan 29, 2011 at 13:06, Stephen Frost <sfrost@snowman.net> wrote:
>> * log_csv_fields's GUC context is PGC_POSTMASTER. Is it by design?
>
> Doing SIGHUP would require addressing how to get all of the backends to
> close the old log file and open the new one, because we don't want to
> have a given log file which has two different CSV formats in it (we
> wouldn't be able to load it into the database...). This was
> specifically addressed in the thread leading up to this patch...
I think it depends default log filename, that contains %S (seconds)
suffix. We can remove %S from log_filename; if we use a log per-day,
those log might contain different columns even after restart. If we
cannot avoid zigged csv fields completely, SIGHUP seems reasonable for it.
>> * What objects do you want to allocate in TopMemoryContext in
>> assign_log_csv_fields() ?
> I just moved the switch to Top to be after those are allocated.
How about changing the type of csv_log_fields from List* to fixed
array of LogCSVFields? If so, we can use an array-initializer
instead of build_default_csvlog_list() ? The code will be simplified.
Fixed length won't be a problem because it would be rare that the
same field are specified many times.
>> * Docs need some tags for itemized elements or pre-formatted codes.
>> They looks itemized in the sgml files, but will be flattened in
>> complied HTML files.
>
> Not sure what you're referring to here...? Can you elaborate? I'm not
> great with the docs. :/
Could you try to "make html" in the doc directory?
Your new decumentation after
| These columns may be included in the CSV output:
will be unaligned plain text without some tags.
--
Itagaki Takahiro