Re: create role in a pl/pgsql trigger - Mailing list pgsql-general

From Craig Ringer
Subject Re: create role in a pl/pgsql trigger
Date
Msg-id 4B5F7BD3.5070708@postnewspapers.com.au
Whole thread Raw
In response to create role in a pl/pgsql trigger  (Keresztury Balázs <balazs@gaslightmusic.hu>)
Responses Re: create role in a pl/pgsql trigger
List pgsql-general
On 27/01/2010 1:09 AM, Keresztury Balázs wrote:
> hi,
>
> I would like to write a trigger on a table which contains detailed
> information about users. If I add a new user to this table, I'd like this
> trigger to add the user to the database as well. Later I also want to
> implement triggers for updating and deleting, but I got stuck at the first
> part of this task.
>
> Everything went fine until the point I had to insert the username into the
> create role command. Appearently the command takes only parameters without
> the ' signs, and the language supports only substituting parameters with the
> apostrophe.
>
> Any idea?

Use 'EXECUTE' (without "USING" because "EXECUTE ... USING" doesn't work
for utility statements).

--
Craig Ringer

pgsql-general by date:

Previous
From: Mike Bresnahan
Date:
Subject: SMP Read-only Performance
Next
From: Scott Marlowe
Date:
Subject: Re: SMP Read-only Performance