X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id EBCCBD1B899 for ; Wed, 20 Aug 2003 18:35:13 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 12758-07 for ; Wed, 20 Aug 2003 18:35:05 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id A4219D1BAFC for ; Wed, 20 Aug 2003 18:35:02 -0300 (ADT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3531427; Wed, 20 Aug 2003 14:34:43 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Matthias Nagl" , pgsql-sql@postgresql.org Subject: Re: problem with automatic altering of groups Date: Wed, 20 Aug 2003 14:32:56 -0700 User-Agent: KMail/1.4.3 References: <200308202118.h7KLI2Q08941@mailgate5.cinetic.de> In-Reply-To: <200308202118.h7KLI2Q08941@mailgate5.cinetic.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308201432.56634.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/253 X-Sequence-Number: 14869 Matthias, > I don't understand why this function ist refused by postgresql with an pa= rse=20 error at the first $1 as ist every=20=20 > other method I tryed to get postgres making an "alter group" with a=20 variable. I'd be very happy if someone=20=20 > could help...=20=20 You can't substitute variables for object names. If you need to construct= =20 dynamic query strings, use PL/pgSQL and EXECUTE: sql_qry :=3D ''ALTER GROUP '' || $group || '' ADD USER '' || $user; EXECUTE sql_query; --=20 -Josh Berkus Aglio Database Solutions San Francisco