Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqFKL-0004wE-PR for pgsql-admin@arkaria.postgresql.org; Fri, 18 Dec 2020 12:57:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kqFKI-0001JK-C7 for pgsql-admin@arkaria.postgresql.org; Fri, 18 Dec 2020 12:57:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqFKI-0001JC-2s for pgsql-admin@lists.postgresql.org; Fri, 18 Dec 2020 12:57:42 +0000 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kqFKF-0005Rk-Nb for pgsql-admin@postgresql.org; Fri, 18 Dec 2020 12:57:40 +0000 Received: by mail-oi1-x22f.google.com with SMTP id 9so2710835oiq.3 for ; Fri, 18 Dec 2020 04:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=wjVW5APyMxXx+cA5KYG/DduqaRvLXol6K5N7wSKwKyo=; b=uZg/Ayf6yUkUvBBF3R0xv22sno7z4IVpSJ30wPz+VxZ9FFrp5XEuxmqPmmKx9o/4Qh idn59B4jsXLpwujfgJM0Sx3CBJb+PBREt6DiRP1UXvob5tz9k04Nx0e79kvFK2vez6uv tIy/C2xQRK7lhaZ6HzDvlqukNxVHzmiSZ3wGj00Ob2QYvIx+foZbiCfyS2SvWBm8TOEr sCuWnJAZeNsiFwid3vRe/SsmfxpDyWsX4yprXkliUIHg5fN5HQiciXe0JUF00U2sraJx 01NtyDKXsTyTg1OXojR6mz88My4vOcFF/BR0fNziqficcJAdpo1IVQO2eQOMkHjM5KOv /TiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=wjVW5APyMxXx+cA5KYG/DduqaRvLXol6K5N7wSKwKyo=; b=JCsb+bol6j79kCxkTMDxP+kD3QlrhxM8k/76sMalFUyuq8QUSjUgneBzSphJ/Ehn2M xmlqcLkhWIaSi/df2L5LI+qV3UrW7l/p2JFyB4HH+mK7nBLZ1GJpbDo4ytIGZ2oqF8rD u+mcBhS6/vCXcSyf6XX70mPcyX8Kxy4116iRdEQdf04FXcgQa6QFbxuEoolWxasijrWw jaZpF5Dgt+vzmpPnU7v2n577YKxoUg5q435vGGLyQNxDPGs4YBNjoqH9bvPuYU+QZAfM su9+j60yTZAzx5fTIqLTUB5ZgPZhYwX9bdELCNE/jQVC96A3zG7BkNSmMVmco+XSYm2E i6tw== X-Gm-Message-State: AOAM531Fn79LN/6OKgN8dHFRtRNiz4wv6C0OU+19Vjr7xy7tvkF1brSW 3LHqWzuBujfUe3486bSFUg7EEl+0JZROWA== X-Google-Smtp-Source: ABdhPJzVR+HP+jC1YwFuuNXz9MA1JoZwl5MyelcXleZUi4TBinY9yS7tlssZ6jfarNSWKI4ZaT8gTg== X-Received: by 2002:a05:6808:a95:: with SMTP id q21mr2635639oij.6.1608296258602; Fri, 18 Dec 2020 04:57:38 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id x31sm1870804otb.4.2020.12.18.04.57.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Dec 2020 04:57:38 -0800 (PST) Subject: Re: User granted all access to schema, but can't see tables To: pgsql-admin References: <0bfc7514-e4ee-375e-be44-24479e728adc@gmail.com> <41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com> From: Ron Message-ID: <43309465-eb73-557c-8941-ddad7e31a5ff@gmail.com> Date: Fri, 18 Dec 2020 06:57:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk The database name is "sides", as show in the psql prompt.  User "stransuser" can connect to the database as shown below when it tries to query tables but gets "permission denied". On 12/18/20 6:26 AM, John Scalia wrote: > Does the stansuser have connect privileges to the actual database where the schema and tables are? > > GRANT connect ON DATABASE TO stansuser; > > Note that since you didn’t tell us what the database name is here, you’ll need to substitute the actual name of it where I indicated . > — > Jay > > Sent from my iPad > >> On Dec 18, 2020, at 7:07 AM, Ron wrote: >> >> This is v12 from RHEL repos. >> >> As user postgres, I run: >> >> sides=# grant all on SCHEMA strans TO stransuser; >> GRANT >> >> sides=# ALTER DEFAULT PRIVILEGES IN SCHEMA strans GRANT all on tables to stransuser; >> ALTER DEFAULT PRIVILEGES >> >> sides=# GRANT USAGE ON SCHEMA strans TO stransuser; >> GRANT >> >> But user stransuser still can’t access tables >> >> sides=> \d >> List of relations >> Schema | Name | Type | Owner >> --------+------------+----------+---------- >> strans | foo | table | postgres >> strans | foo_id_seq | sequence | postgres >> (2 rows) >> >> sides=> select * from strans.foo; >> ERROR: permission denied for table foo >> >> sides=> \z strans.foo >> Access privileges >> Schema | Name | Type | Access privileges | Column privileges | Policies >> --------+------+-------+---------------------------+-------------------+---------- >> strans | foo | table | postgres=arwdDxt/postgres+| | >> | | | READWRITE=arwdD/postgres +| | >> | | | READONLY=r/postgres | | >> (1 row) >> >> What am I missing? >> >> -- >> Angular momentum makes the world go 'round. >> >> -- Angular momentum makes the world go 'round.