PLPGSQL 'SET SESSION ROLE' problems ..

From: "Greg Wickham" <Greg(dot)Wickham(at)aarnet(dot)edu(dot)au>
To: <pgsql-general(at)postgresql(dot)org>
Subject: PLPGSQL 'SET SESSION ROLE' problems ..
Date: 2007-10-11 04:15:16
Message-ID: 964C943783CDCE4BBA0CE327AA8E7BA5C28176@vm-a-ex1.ms.aarnet.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

Is it possible to change the current role to another arbitrary role
using a PLPGSQL function?

In essence I've a function "authorise" created by the db superuser with
'SECURITY DEFINER' specificied.

However from within plpgsql the 'superuser' attribute isn't honored when
trying to change roles (ie: the non 'superuser' rules for role change
must be honoured).

Postgresql version 8.2.3

Is this a bug? .. If not, how do I achieve an 'adhoc' change of role
from within the "rules system"?

tnx,

-greg

--
Dr. Greg Wickham Program Manager, e-Research
Phone: +61 2 6222 3552 AARNet
Mob: +61 4 0785 4566 CSIRO, Building 9, Banks St
Email: greg(dot)wickham(at)aarnet(dot)edu(dot)au Yarralumla ACT 2600

Responses

Browse pgsql-general by date

  From Date Subject
Next Message longlong 2007-10-11 04:21:37 silent install
Previous Message Erik Jones 2007-10-11 04:08:18 Re: 8.2.4 selects make applications wait indefinitely