Re: change current user in pl/pgsql function

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Sergey Karin <sergey(dot)karin(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: change current user in pl/pgsql function
Date: 2006-02-06 14:32:50
Message-ID: 20060206143250.GA31046@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 06, 2006 at 15:43:30 +0300,
Sergey Karin <sergey(dot)karin(at)gmail(dot)com> wrote:
> Hi, List!
>
> I use PG8.1
>
> Are there any abilities to change current user during pl/pgsql function
> execution?
> I developed function that have 'security definer' option and created under
> superuser. But for executing some command in the function I need to change
> user to session_user and after execotion change user to superuser.

You can probably do what you want by having the top level function
run with the caller's security and have it call security definer functions
as necessary.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shahid Butt 2006-02-06 15:33:47 Trying to auto start Postgres when server boots up
Previous Message Simon Riggs 2006-02-06 13:40:37 Re: [HACKERS] Logging statements and parameter values