Re: Fwd: Log file

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Fwd: Log file
Date: 2018-10-29 20:48:17
Message-ID: CA+FnnTwb4V++4WRQj1vCBQ0Pb_NPR3pxjJgyGpuCXHOhFuXpmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-odbc

Hi, Tom,

On Mon, Oct 29, 2018 at 1:56 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> 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.

OK, that clarifies it a little.
I thought I could just crate a user called "igor", give him all
"postgres" permissions
and login to the server as "igor" and not "postgres" every time I test.
But since the server will probably run from the "postgres" account
during the machine
start-up that won't work.

>
> > 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.

The current_user = user who logged in to the machine and open the
current session.
If I log in to the machine as "igor" and try to create a file in vi/nano/notepad
I will be the owner of this file and the group will be the group to which
I belong as a user.

And I'm talking about specifically to the result of the "ls -la"
output from the *nix/OSX
POV.

>
> > 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.

I'm trying to make the log file of PG readable of the user who logs in
to the current
OS session. I don't need a write permission, just read.
Because my program will not be started from the "postgres" account.

Thank you.

>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-10-29 21:08:55 Re: Fwd: Log file
Previous Message Rich Shepard 2018-10-29 20:21:37 Re: Redirecting select() output generates error [FIXED]

Browse pgsql-odbc by date

  From Date Subject
Next Message Tom Lane 2018-10-29 21:08:55 Re: Fwd: Log file
Previous Message Tom Lane 2018-10-29 18:56:06 Re: Fwd: Log file