Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZhLYT-00071Z-13 for pgsql-admin@arkaria.postgresql.org; Wed, 30 Sep 2015 17:52:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZhLYS-0002XG-9m for pgsql-admin@arkaria.postgresql.org; Wed, 30 Sep 2015 17:52:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZhLYR-0002X9-QY for pgsql-admin@postgresql.org; Wed, 30 Sep 2015 17:52:35 +0000 Received: from mail-qk0-f180.google.com ([209.85.220.180]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZhLYO-0004FF-AV for pgsql-admin@postgresql.org; Wed, 30 Sep 2015 17:52:35 +0000 Received: by qkbi190 with SMTP id i190so871174qkb.1 for ; Wed, 30 Sep 2015 10:52:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=a6gGYh7CdsgTfNRxXb4LIky0fKq9ecFctLieVWscfKM=; b=DPfKTvKOQFTGKzhnlQhSIj7m+qTvsM//I2uPawFEeKddxhVJhDzIdd5NgqG0P01W4X 9JvXMuK8y5/diXu9+1tXl7uG+EuT2TT6cZS3VogBGpfC6yPppf6+Ym8vWIX9kUeknyqU Zb047a2e0ssvt8UwTacm8/bQtbF7D6p7w0RpQNcmOkVJZWkvwM1FagaaKUwG837DUjiF /GHCvKNc1jp4OUxfScIDFyYH0gifn+kDmtNsn8AiRIl4GVGVnDVTLF5350rmOkpTRo7a bZdFmNf1r8/An39Pslxq5b69Isbe7yJeW/MytbRX/vtWbLvINUoGomZBV8Uyr+CVmydS C4rw== X-Gm-Message-State: ALoCoQlCczECIMjef4cDbFaZZEKPbV6KPBzubwvf7IXcaeXW/MLnEqWo0I6OCvnX9hInLTmufam4 X-Received: by 10.55.20.164 with SMTP id 36mr5866408qku.54.1443635550210; Wed, 30 Sep 2015 10:52:30 -0700 (PDT) Received: from MegaMac.local (va-76-4-65-131.sta.embarqhsd.net. [76.4.65.131]) by smtp.gmail.com with ESMTPSA id b104sm687783qga.7.2015.09.30.10.52.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Sep 2015 10:52:28 -0700 (PDT) Message-ID: <560C2101.7020807@enterprisedb.com> Date: Wed, 30 Sep 2015 13:50:57 -0400 From: Korry Douglas User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Scalia CC: "pgsql-admin@postgresql.org" Subject: Re: Adding group role to a user References: <560C1AC5.7040401@enterprisedb.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------070101060400090003070805" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --------------070101060400090003070805 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit It would have been polite of me to include a reference, apologies. Group names and user names (which are really /role/ names) are considered to be identifiers. This page explains the quoting rules for identifiers in PostgreSQL: http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html -- Korry > I think that was only variant I hadn't tried. Looking through the > history I had only used a single quote around the group name, not a > double, but that did work. > > Thanks, > Jay > > On Wed, Sep 30, 2015 at 12:24 PM, Korry Douglas > > wrote: > > > ALTER GROUP "schema-rw" ADD USER someuser. > > > -- Korry > > > Someone here in their infinite wisdom decided that all our > group names would contain a "-". Thus, all the groups look > like "schema-ro" or "schema-rw", My problem is that neither a > "grant to ;" nor a "alter group > add user " will work properly as the > command interpreter doesn't like the group name having a "-" > in it. > > So, I'm looking for a work-around up to and including directly > altering the pg_auth table. Any ideas? > -- > Jay > > > --------------070101060400090003070805 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

It would have been polite of me to include a reference, apologies.

Group names and user names (which are really role names) are considered to be identifiers.  This page explains the quoting rules for identifiers in PostgreSQL:  http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html


                -- Korry

I think that was only variant I hadn't tried. Looking through the history I had only used a single quote around the group name, not a double, but that did work.

Thanks,
Jay

On Wed, Sep 30, 2015 at 12:24 PM, Korry Douglas <korry.douglas@enterprisedb.com> wrote:

ALTER GROUP "schema-rw" ADD USER someuser.


                -- Korry


Someone here in their infinite wisdom decided that all our group names would contain a "-". Thus, all the groups look like "schema-ro" or "schema-rw", My problem is that neither a "grant <group-name> to <user>;" nor a "alter group <group-name> add user <user>" will work properly as the command interpreter doesn't like the group name having a "-" in it.

So, I'm looking for a work-around up to and including directly altering the pg_auth table. Any ideas?
--
Jay



--------------070101060400090003070805--