Re: problem with automatic altering of groups - Mailing list pgsql-sql

From Josh Berkus
Subject Re: problem with automatic altering of groups
Date
Msg-id 200308201432.56634.josh@agliodbs.com
Whole thread Raw
In response to problem with automatic altering of groups  ("Matthias Nagl" <mnagl@web.de>)
List pgsql-sql
Matthias,

> I don't understand why this function ist refused by postgresql with an parse
error at the first $1 as ist every
> other method I tryed to get postgres making an "alter group" with a
variable. I'd be very happy if someone
> could help...

You can't substitute variables for object names.   If you need to construct
dynamic query strings, use PL/pgSQL and EXECUTE:

sql_qry := ''ALTER GROUP '' || $group || '' ADD USER '' || $user;
EXECUTE sql_query;


--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: LAIN Lucas TECHTEL
Date:
Subject: Re: Configuring Problem on Solaris............
Next
From: Stephan Szabo
Date:
Subject: Re: "SELECT IN" Still Broken in 7.4b