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 1l4Jdq-0005Gp-KU for pgsql-docs@arkaria.postgresql.org; Tue, 26 Jan 2021 08:24:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4Jdp-0005ly-Ju for pgsql-docs@arkaria.postgresql.org; Tue, 26 Jan 2021 08:24:01 +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 1l4J2L-0005L0-G9 for pgsql-docs@lists.postgresql.org; Tue, 26 Jan 2021 07:45:17 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l4J2I-0003AT-Ta for pgsql-docs@lists.postgresql.org; Tue, 26 Jan 2021 07:45:16 +0000 Received: by mail-qt1-x831.google.com with SMTP id c12so11645940qtv.5 for ; Mon, 25 Jan 2021 23:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybercoment-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=QjOnC/VYQAUllb9k1xDCSWV3GFaJI46cw7ubnRnsvY0=; b=ROhT06lqB4QqhHRuk6uM26KMztQujlG63+SJG0Exx6skclVt0tQYURJxnmdCvR1rxL aK7a1775uUH/B8GVTsrewPxzz+ijzt2JhgRNk6DBWNPqHo05fMSY0AVwBqhTORbj5b+W 66A52Q/bsklLv0jQPAJDIqxwOZM6zE7Eu1gDRsDc8z2B0anI//eHOkRIBxZ4lzDPFW9v 0ArZ0Lfp9sKacZZR3E6m+vXgZ1//9m6HK5w/+M5Pb6v3iABDsxDBonMarovatXEpBkMS tEvws1lElRt7QrckgI9Fw9ZPcoU5X6LZK+pxReiuorwdZLBgpc+LmMNITmYJ1z+JeOmL l5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=QjOnC/VYQAUllb9k1xDCSWV3GFaJI46cw7ubnRnsvY0=; b=tk8XARDNJBryd5SHM10L8Fh0wXesINnKLsmclKQH81KuFCrVgXScxd+fG41qb2I2Xg aEqMxygvh+AJOkgwfHZ5iAsCjWXb4RieOFsOrLxhkb/izwqct01iPIoV5xc2b8gqT7qD dVQxUQLXZShEptMDu3JkPTf1fzzqOmDk2F7DNdY6UMjIZnjxdNt6SlKbRSfeXLn74tgY LC5aorR9dPqpwkhKLRgra8B6Qma9exzcCC3667GN3Gm85BZWfaZebOJBv7I0EhUW9IdU +aq/RVGrYTw//rGF3dFrLxbQ+IJGKf1E7xJA+MAA+I/1dfoqa9JmYd9nSZx8B69xcxZr XmoA== X-Gm-Message-State: AOAM533yyD2DNEjDZLSBCFP0jX6nucNwfMhGH2Wj6I8xuoiw41ErAP+s rLGs2QSC6DEAhAUE6dQ6oeDx+w== X-Google-Smtp-Source: ABdhPJzR63vyta/d5G9956ngz103O/LVV4hLH0HkYcj+Pwu38IJghMicVhLTQA21EBiAZi7LgA7xGw== X-Received: by 2002:ac8:6b90:: with SMTP id z16mr3977636qts.245.1611647113692; Mon, 25 Jan 2021 23:45:13 -0800 (PST) Received: from hank.localdomain (205-178-107-98.s3423.c3-0.stk-ubr1.chi-stk.il.cable.rcncustomer.com. [205.178.107.98]) by smtp.gmail.com with ESMTPSA id a188sm5649419qkg.33.2021.01.25.23.45.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2021 23:45:12 -0800 (PST) From: Charlie Hayes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Postgres upgrade does not mention requirement to have only 1 user Date: Tue, 26 Jan 2021 01:45:09 -0600 References: <161164427375.4070.1378381620788426246@wrigleys.postgresql.org> To: Charles William Hayes , pgsql-docs@lists.postgresql.org In-Reply-To: <161164427375.4070.1378381620788426246@wrigleys.postgresql.org> Message-Id: X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I see now that the user check was verifying the target database and not = the source. My upgrade script (which I used from 11 to 12) initialized = the target database for upgrades as it did for seeding from scratch = which included a user account. I removed that part of the script and the = upgrade completed successfully. I maintain that the documentation and error message could be improved = and the process remains rough. Thanks, Charlie > On Jan 26, 2021, at 12:57 AM, PG Doc comments form = wrote: >=20 > The following documentation comment has been logged on the website: >=20 > Page: https://www.postgresql.org/docs/13/pgupgrade.html > Description: >=20 > During the pg_upgrade process, a check is run to make sure > pg_catalog.pg_roles has only a single non pg_* user, typically this is = just > 'postgres'. If this check fails, the error message is "Only the = install user > can be defined in the new cluster."; This message implies the user = executing > pg_upgrade must match the the rolsuper in pg_catalog.pg_roles. >=20 > There's no indication in the documentation that the user table must be > flushed of all but the one user, nor does it prescribe a method to = move > forward. The error message is not helpful; I only figured it out by = finding > and reading the postgres source code. >=20 > I'll add that this upgrade process is quite rough. The instructions = dictate > the install happen on the new version and to reference the old = binaries; > this can be tricky to setup because simply installing the new version = often > removes the old version. I use the docker image so the old version is = not > present on the new docker image. After spending quite some time = getting the > two versions in line and running the upgrade, I ran into this user = issue. I > suspect I need to delete all users from the database before running = the > upgrade, and obviously that must happen on the old version, which > essentially precludes a new version from 'adopting' an old version's = data > files. This also encourages application developers to use the default > superuser for all db access which is a bad practice. >=20 > I'm fine with the upgrade needing to be explicit, but Ideally there = would be > no need to load the old binaries or prep the user table.