Re: create role in a pl/pgsql trigger

From: Keresztury Balázs <balazs(at)gaslightmusic(dot)hu>
To: "'Craig Ringer'" <craig(at)postnewspapers(dot)com(dot)au>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: create role in a pl/pgsql trigger
Date: 2010-01-27 09:34:51
Message-ID: 001201ca9f33$fac42ef0$f04c8cd0$@hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Craig, this one worked!

Balazs

-----Original Message-----
From: Craig Ringer [mailto:craig(at)postnewspapers(dot)com(dot)au]
Sent: Wednesday, January 27, 2010 12:34 AM
To: Keresztury Balázs
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] create role in a pl/pgsql trigger

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pierre Chevalier 2010-01-27 09:49:03 Re: dynamic crosstab
Previous Message Pavel Stehule 2010-01-27 09:14:28 Re: dynamic crosstab