Re: 2 questions

From: anj patnaik <patna73(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: 2 questions
Date: 2015-11-27 21:17:09
Message-ID: CAEQKwSnOYYocdBno-np=TGjbxsdEr8s4BovpcPPEMp5gGuNp-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
Yes, postgres is currently installed on a nfs mounted file system. So when
graphical installer runs, there is a form which asks location for
installation. I specified this path /opt/nfsDir/Postgres where nfsDir is a
nfs mount. So currently this is where PG 9.4 lives.

My question is when I am given a brand new VM on a different physical
server, can I mount that same NFS FS and use the Postgres or do I need to
re-install PG on new VM?

I am not sure if PG writes to any other directories besides the one where
it is installed.

On the issue of logging, I see a lot of log statements because client apps
do upserts and since I use Tcl I don't have a SQL proc, but rather I let it
exception and then do an update on the row.

So, you can limit the size of an individual log, but there is no way to
tell PG to keep the log file short?

if i choose FATAL, I'd lose some log, right?

Thank you!
ap

On Fri, Nov 27, 2015 at 10:19 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 11/25/2015 10:28 AM, anj patnaik wrote:
>
>> Hello all,
>> I've got 2 more questions. The cron job is now setup and email gets
>> generated with proper body.
>>
>> I've one setup with NFS which appears to work smoothly. Now soon, I will
>> be given a Linux VM on a different physical server, but will retain my
>> NFS mount. I've installed Postgres 9.4 using the graphical installer and
>> specified the directory for the nfs mount.
>>
>
> Define 'setup with NFS'.
>
> So are you saying this how you set up the old instance or how you are
> setting up the new VM?
>
>
>> 1) When I move to the new VM, can I keep using that NFS mount without
>> having to do a re-install of PG? This would be a different physical
>> machine.
>>
>
> Where is Postgres installed now?
>
> Not entirely following, but I hope you are not asking if two Postgres
> installs can share the same NFS mount? That will end badly.
>
>
> It might help if you give a schematic description of what you are trying
> to achieve.
>
>
>> 2) I have a cron job that deletes log files older than 10 days, but I am
>> noticing rather large log files. Is there a way to limit the size of log
>> files?
>>
>
> What I do is keep the previous 2 days of files as written and then keep
> compressed files older then that to some period of time. The files compress
> a good bit so it works well for me. This is done via a cron script that
> runs each night.
>
>
>> users do upserts and they are valid, but those are getting dumped as
>> error statements. I set the verbosity to "terse", but still seeing lots
>> of log output.
>>
>
> So what are the errors?
>
> As to 'terse':
>
>
> http://www.postgresql.org/docs/9.4/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT
> log_error_verbosity (enum)
>
> Controls the amount of detail written in the server log for each
> message that is logged. Valid values are TERSE, DEFAULT, and VERBOSE, each
> adding more fields to displayed messages. TERSE excludes the logging of
> DETAIL, HINT, QUERY, and CONTEXT error information. VERBOSE output includes
> the SQLSTATE error code (see also Appendix A) and the source code file
> name, function name, and line number that generated the error. Only
> superusers can change this setting.
>
>
> You lose a lot of valuable information this way. I would go with Albe's
> suggestion and change log_min_error_statement.
>
>
>
>
>> My settings are as follows:
>> postgres=# select name,setting,unit from pg_settings where name like
>> '%log%';
>> name | setting | unit
>> -----------------------------+--------------------------------+------
>> log_autovacuum_min_duration | -1 | ms
>> log_checkpoints | off |
>> log_connections | off |
>> log_destination | stderr |
>> log_directory | pg_log |
>> log_disconnections | off |
>> log_duration | off |
>> log_error_verbosity | terse |
>> log_executor_stats | off |
>> log_file_mode | 0600 |
>> log_filename | postgresql-%Y-%m-%d_%H%M%S.log |
>> log_hostname | off |
>> log_line_prefix | %t |
>> log_lock_waits | off |
>> log_min_duration_statement | -1 | ms
>> log_min_error_statement | error |
>> log_min_messages | error |
>> log_parser_stats | off |
>> log_planner_stats | off |
>> log_rotation_age | 1440 | min
>> log_rotation_size | 10240 | kB
>> log_statement | none |
>> log_statement_stats | off |
>> log_temp_files | -1 | kB
>> log_timezone | EST5EDT |
>> log_truncate_on_rotation | off |
>> logging_collector | on |
>> syslog_facility | local0 |
>> syslog_ident | postgres |
>> wal_log_hints | off |
>> (30 rows)
>>
>> postgres=#
>>
>>
>> Thank you.
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DrakoRod 2015-11-27 23:45:41 FATAL: unable to read data from DB node 0
Previous Message Adrian Klaver 2015-11-27 17:23:39 Re: Re: [webmaster] How to commit/vacuum a batch of delete statements in a postgresql function