Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A5EAF1337B5D for ; Fri, 31 Dec 2010 13:05:46 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 17202-06 for ; Fri, 31 Dec 2010 17:05:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com [209.85.216.46]) by mail.postgresql.org (Postfix) with ESMTP id 3334C1337B5B for ; Fri, 31 Dec 2010 13:05:38 -0400 (AST) Received: by qwa26 with SMTP id 26so12035407qwa.19 for ; Fri, 31 Dec 2010 09:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=VixqHyYoNMiyUVQfTaxtpXQnEZ2RKjydUskx8CsbgX4=; b=PTTiR50tSryFLxYSMAeGv5QKEta/yHMXDonDw8jaETAhSEc9b2If6g/s8dfduFWhmc Vl/bMaTql5Twyi+QyjAXGW62Q36VzYU11JrDZce0c9MycqmuK+loI7byvsUj8MdWiYgg tuMjlN/hLiKm3MnzmpTYunBEuUoVMUDXYXTQk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=jXWYbQIvi9k9Q4F+fJlSHpCbfEoHbAdcfzBd+P5aXZYLPc5SrsARDpHw40BOHDu0wt 5tbsb5erv0pbADrQO07D7KlwJoRzQ3EkLa5zJv6oLHIlVkHZjujC7/3NkGU5rkrffZSj viToXGsd84o+KtuTDiiihcrRhjLbTFr2dxA24= Received: by 10.224.67.66 with SMTP id q2mr16759306qai.174.1293815137878; Fri, 31 Dec 2010 09:05:37 -0800 (PST) Received: from tucker.local (c-24-17-164-54.hsd1.wa.comcast.net [24.17.164.54]) by mx.google.com with ESMTPS id nb15sm9198605qcb.2.2010.12.31.09.05.36 (version=SSLv3 cipher=RC4-MD5); Fri, 31 Dec 2010 09:05:37 -0800 (PST) From: Adrian Klaver Reply-To: adrian.klaver@gmail.com To: pgsql-sql@postgresql.org Subject: Re: create role Date: Fri, 31 Dec 2010 09:05:35 -0800 User-Agent: KMail/1.9.10 Cc: tcapobianco@prospectiv.com, "Gibransyah Fakhri" References: <1293747263.1650.7.camel@tony1.localdomain> <6b49785d598885ab7f8c5d3955afd74c.squirrel@mail.prospectiv.com> In-Reply-To: <6b49785d598885ab7f8c5d3955afd74c.squirrel@mail.prospectiv.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201012310905.35527.adrian.klaver@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.588 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201012/111 X-Sequence-Number: 34947 On Friday 31 December 2010 8:22:23 am tcapobianco@prospectiv.com wrote: > > On 31 December 2010 05:14, Tony Capobianco > > > > wrote: > >> esave_dw=3D> \d members > >> Did not find any relation named "members". > >> esave_dw=3D> > >> esave_dw=3D> \d esave.members > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Table "esave.members" > >> =A0 =A0 =A0 Column =A0 =A0 =A0 =A0| =A0 =A0 =A0 =A0 =A0 =A0Type =A0 = =A0 =A0 =A0 =A0 =A0 | Modifiers > >> ---------------------+-----------------------------+----------- > >> =A0memberid =A0 =A0 =A0 =A0 =A0 =A0| numeric =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 | not null > >> =A0etc.... > >> > >> How can I get this so I don't have to preface the \d with the schema > >> name every time? > > > > Hi Tony, you should changes the default search_path for the specified > > users. > > http://sql-info.de/postgresql/schemas.html > > take a look at practical schema usage section. > > Gibransyah, > That did the trick! Thanks for your help. I modified my role name from > developer to dev since I already have a dev schema. Here's the steps I > ran below to get it working: > > create role dev login; > alter role dev set default_tablespace=3Ddev; > alter role dev set search_path=3Ddev,staging, esave, support, email,publi= c; > > grant usage on schema esave to dev; > grant usage on schema dev to dev; > grant select on members to dev; > grant create on schema dev to dev; > grant create on tablespace dev to dev; > > I am a little confused as to why I had to grant usage & create on dev to > dev since it's both the dev role's default_tablespace and has a schema > named after it. Either way, this corrects my issue. Thanks for your > help! > > Tony In my previous message I forgot to add the following. The set commands and grants are not linked. Setting something does not=20 necessarily confer privileges for that object. The search_path for instance= =2E It=20 really only sets up the search order for unqualified object names. What you= can=20 see or do with those objects is determined by the privileges on those objec= ts.=20 Those privileges come from either the role that created the object or are=20 GRANT(ed) by a sufficiently privileged role to another role. =2D-=20 Adrian Klaver adrian.klaver@gmail.com