Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gX4IP-0006Xj-M8 for pgsql-general@arkaria.postgresql.org; Wed, 12 Dec 2018 13:11:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gX4IO-0000Q9-DS for pgsql-general@arkaria.postgresql.org; Wed, 12 Dec 2018 13:11:24 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gX4IO-0000Q2-5M for pgsql-general@lists.postgresql.org; Wed, 12 Dec 2018 13:11:24 +0000 Received: from evolu-s.it ([94.23.66.144] helo=smtp.evolu-s.it) by magus.postgresql.org with smtp (Exim 4.89) (envelope-from ) id 1gX4IM-00081k-5k for pgsql-general@postgresql.org; Wed, 12 Dec 2018 13:11:23 +0000 Received: from [192.168.1.163] ([79.6.30.247]) by smtp.evolu-s.it ; Wed, 12 Dec 2018 14:11:21 +0100 To: PostgreSQL mailing lists From: Moreno Andreo Subject: REVOKE to an user that doesn't exist Message-ID: Date: Wed, 12 Dec 2018 14:11:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit Content-Language: it List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exist command was: REVOKE ALL ON FUNCTION "x"() FROM PUBLIC; GRANT ALL ON FUNCTION "public"."x"() TO "1067431" WITH GRANT OPTION; Here's the evidence :-) postgres=# \du                                 List of roles     Role name    |                    Attributes                    | Member of ------------------+-------------------------------------------------+-----------  user5          | Create role, Create DB                         | {}  user2     | Superuser, Create role, Create DB, Replication | {}  user4 | Create role, Create DB                         | {}  user3       |                                                 | {}  user1      | Superuser, Create role, Create DB, Replication | {}  postgres         | Superuser, Create role, Create DB, Replication | {} postgres=# select * from pg_roles;      rolname      | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcatupdate | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolconfig |   oid ------------------+----------+------------+---------------+-------------+--------------+-------------+----------------+--------------+-------------+---------------+-----------+---------  postgres         | t        | t          | t             | t           | t            | t           | t |           -1 | ********    |               |           |      10  user1      | t        | t          | t             | t | t            | t           | t              |           -1 | ********    |               |           |   16393  user2     | t        | t          | t             | t           | t            | t           | t              |           -1 | ********    |               |           |   16394  user3       | f        | t          | f             | f | f            | t           | f              |           -1 | ********    |               |           |   16395  user4 | f        | t          | t             | t           | f            | t           | f              |           -1 | ********    |               |           | 1067432  user5          | f        | t          | t             | t           | f            | t           | f |           -1 | ********    |               |           |   30602 (6 rows) So, no user with that OID. I checked in the trigger pointed to the error and I found GRANT EXECUTE ON FUNCTION x() TO "1067431" WITH GRANT OPTION; How to REVOKE that non-existing user so pg_upgrade can proceed? thanks Moreno.-