Re: Background worker process

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "Brandl, Wolfgang" <wolfgang(dot)brandl(at)brz(dot)gv(dot)at>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Background worker process
Date: 2017-12-19 12:41:18
Message-ID: 1513687278.2428.7.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Wolfgang Brandl wrote:
> We want to start processes controlled by a prostgres table which acts like crontab.
> So we want to start a background worker process which starts the defined functions.
>
> Is it possible to start from a background worker process a child process with a specific User.

> So this process can only acces the data for his authority.
> Like a SQL Intrusion with this definition nobody can start a process a Postgres superuser.

You normally do things like that on UNIX-like operating systems by
setting the "setuid" bit on the executable that you want to start
and transferring ownership to the desired user.

There is no other way for a non-root user like "postgres" to start
an executable as a different user.

Your setup seems complicated.
Why don't you have a daemon process running as root outside of PostgreSQL
that regularly checks the table and starts scheduled processes?

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Stark 2017-12-19 14:14:34 Re: Estimate maintenance_work_mem for CREATE INDEX
Previous Message Francis Santiago 2017-12-19 12:36:33 Re: Couldn't create plperl language