Re: Fwd: Log file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Fwd: Log file
Date: 2018-10-29 18:56:06
Message-ID: 18469.1540839366@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

Igor Korot <ikorot01(at)gmail(dot)com> writes:
> I'm trying to test the functionality of logging on my older Mac with
> PostgreSQL 9.1.
> I see that the logile is created with the owner of postgres and the
> group of wheel.

Well, more specifically, it's created under the OS user & group that
the server is running under.

> Is there a way to make it open with "<current_user><current_user>"?

What current user? The SQL user name might not correspond to any
OS-level entity at all. Even if it did, it's quite unlikely that
the OS would permit the server process to create files owned by
some other OS user --- doing so would be a giant security risk.

> Or I will have to change the owner/group manuall every time I will
> access the file?

You can set up the log files as readable by the OS group of the server
(see log_file_mode), and then grant membership in that group to whichever
OS accounts you trust. You may also need to move the log directory
out from under $PGDATA to make that work, since PG doesn't like
world-readable data directories.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2018-10-29 18:59:35 Re: Redirecting select() output generates error
Previous Message Rich Shepard 2018-10-29 18:46:35 Redirecting select() output generates error

Browse pgsql-odbc by date

  From Date Subject
Next Message Igor Korot 2018-10-29 20:48:17 Re: Fwd: Log file
Previous Message Igor Korot 2018-10-29 16:56:55 Re: Log file