pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: L Bayuk <lbayuk@pobox.com>
To: pgsql-admin@postgresql.org
Subject: 8.2.0 upgrade issue: loss of CONNECT rights
Date: Wed, 27 Dec 2006 19:45:46 -0500
Message-ID: <20061228004546.GB364@mail.mindspring.com> (raw)

Another thing to watch out for when upgrading to 8.2.0:

I had some 8.1.x databases with restricted rights, like REVOKE CREATE ON
DATABASE. After pg_dumpall and reload into 8.2.0, I lost CONNECT rights on
those databases. So only the superuser account can connect.  The reason
seems to be that my dump file had REVOKE ALL ON DATABASE, then added the
specific GRANT rights. At 8.2.0, REVOKE ALL includes revoking CONNECT
rights even though they were always granted at 8.1.5.

For example, here are my database rights under 8.1.5:
   {postgres=CT/postgres,=T/postgres,lbayuk=C/postgres}
So public has TEMP, I have CREATE (and TEMP, via public).

My dump file had something like this:
   CREATE DATABASE test WITH ...
   REVOKE ALL ON DATABASE test FROM PUBLIC;
   REVOKE ALL ON DATABASE test FROM postgres;
   GRANT ALL ON DATABASE test TO postgres;
   GRANT TEMPORARY ON DATABASE test TO PUBLIC;
   GRANT CREATE ON DATABASE test TO lbayuk;

After the upgrade to 8.2.0 the database rights are:
   {postgres=CTc/postgres,=T/postgres,lbayuk=C/postgres}
So now me and PUBLIC cannot connect because we don't have the new 'c' right.

I tried using both 8.1.5 pg_dumpall and 8.2.0 pg_dumpall to dump the
8.1.5 database, and both had the problem.
To fix: GRANT CONNECT ON DATABASE ... TO PUBLIC;



view thread (3+ messages)  latest in thread

Message-ID: <20061228004546.GB364@mail.mindspring.com>
Permalink:  ../20061228004546.GB364@mail.mindspring.com/
Also on:    postgresql.org/message-id/20061228004546.GB364@mail.mindspring.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: lbayuk@pobox.com
  Subject: Re: 8.2.0 upgrade issue: loss of CONNECT rights
  In-Reply-To: <20061228004546.GB364@mail.mindspring.com>
  References: <20061228004546.GB364@mail.mindspring.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox