Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smgMD-007Yb0-Gz for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Sep 2024 21:19:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1smgMB-0047xK-KI for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Sep 2024 21:19:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smgMB-0047vu-60 for pgsql-bugs@lists.postgresql.org; Fri, 06 Sep 2024 21:19:03 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1smgM8-000VSV-O1 for pgsql-bugs@lists.postgresql.org; Fri, 06 Sep 2024 21:19:02 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42bbe809b06so18706925e9.1 for ; Fri, 06 Sep 2024 14:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1725657539; x=1726262339; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=6TTZLdLBKgXVz56qu/hfdoJdIqrlrIfqfq9be3TdohM=; b=S74aWGV2EJOla5ERXUctEckrxeDBoNO0ibvlN6uyLH2FsHrr7cZjKws94RRLV3FDpF BSuBAiqV8xZawQ/LnwWeS4HK6gWlhKTsknUuZbcSZUBHqwhFogGHmZKAQZDrAaKjyb2N J4Kn69C/cs0i5piHTGDggViMHJlRXdBBI796c+B+VFJIKEjw6k9vdiKqG/Owe33yQbUz CKcYtUqLykLD/4tqzS7fQpUPdcsDb4JdYze/neMMSw5NXeGL6PLLJuisip8TIfPdTp2d s33TnC6xrerWoReafLwn8TYkgyNirdI5577vYfU3YKK8wZjmbziQHKtJY7HtItQ0XV7L bgyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725657539; x=1726262339; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6TTZLdLBKgXVz56qu/hfdoJdIqrlrIfqfq9be3TdohM=; b=Q+EhA3031vlxZMmH2kNeyzORJxAUms1NfIAsVl/CIUhFAz9Lzv6HRrhj7yCZmvZVn+ qyYJU2PBl2CT5DxiVOyZdiR1NV9MuZU7xGBn2c6Ahah5CSI6DN/Zi/6unmdxdXFjZBHt dGFMlOEWY2JfxQrCNPDiXs+KgIqqH6jeJmFXA56Ude3fNrTFLoYgfh7ATkr4nFhTiUcG GnqY4lOMgpqsGrmZmcHLCHWev0TaCJ39mWKSZj22SFd8LpeV4502/Gd4ZsP5bZ3+w41F YiW/8RHNv6u/RGL6XX/0/K5+uzOCe7Uph8KPtGSiCl8HYeUvoBhFgpWFo17lrO6XnH7U ggFw== X-Gm-Message-State: AOJu0YzkT2WpRrtFCnQZECNoMglUURJPHwmy7oQ13WRVZYRsPnHIK1rC x5W6C+i6/dWxPmbbNno+a+V5IjB7qwcM8TH2VXMjwOUre4TN2ohT9hratUjIw7Y= X-Google-Smtp-Source: AGHT+IEEk8Qa16m54kUxDi9njmnApqePDXhAygbEf+ZCwuh0s3JqVPVZddXnQxhDWUKbxvtvHtdP9w== X-Received: by 2002:a05:600c:4446:b0:426:593c:9361 with SMTP id 5b1f17b1804b1-42cad87efbbmr3462135e9.26.1725657538380; Fri, 06 Sep 2024 14:18:58 -0700 (PDT) Received: from dynamic-pd01.res.v6.highway.a1.net ([2001:871:260:d2e4:ac93:a861:74df:eb8a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca05f9ac2sm30734905e9.47.2024.09.06.14.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 14:18:57 -0700 (PDT) Message-ID: Subject: Re: [EXT]: Re: BUG #18604: Regression in PostgreSQL 16.4: pg_dump Prevents Essential System Table Modifications From: Laurenz Albe To: Basha , Christophe Pettus Cc: PostgreSQL Bug List Date: Fri, 06 Sep 2024 23:18:57 +0200 In-Reply-To: References: <18604-04d64b68e981ced6@postgresql.org> <3B462E2E-88B6-43B9-943F-90E883D33357@thebuild.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2024-09-06 at 20:46 +0000, Basha wrote: > Please find below the details as what system catalog modifications were d= one and why. >=20 > We provide our customers with access to their respective representative d= atabases > (Rep DB) within a multi-tenant PostgreSQL architecture. Each customer is = assigned > their own dedicated database, and for each database, a corresponding role= is created > with the necessary permissions. >=20 > For example, for customers such as: > Abc > Def > Xyz >=20 > the below user-roles: >=20 > Abc_usr for the Abc database > Def_usr for the Def database > Xyz_usr for the Xyz database >=20 > These roles are configured to have 'connect' privileges solely to their r= espective > databases, ensuring isolation. For instance, only Abc_usr can connect to = the Abc > database, and this applies similarly to other users and databases. >=20 > To enhance security and prevent customers from viewing other database nam= es in the > system, we made modifications to the PostgreSQL system tables and created= custom > views that restrict the visibility of databases for each user. >=20 > Below are the changes >=20 > Step1 : > Set the config allow_system_table_mods =3D on >=20 > Step 2: > ALTER TABLE pg_catalog.pg_database RENAME TO pg_database_catalog; >=20 > Step3: >=20 > CREATE OR REPLACE VIEW pg_catalog.pg_database > AS > SELECT oid, > datname, > datdba, > encoding, > datlocprovider, > datistemplate, > datallowconn, > datconnlimit, > datfrozenxid, > datminmxid, > dattablespace, > datcollate, > datctype, > daticulocale, > daticurules, > datcollversion, > datacl, > 1262::oid AS tableoid > FROM pg_database_catalog > WHERE 1 =3D 1 AND has_database_privilege(oid, 'connect'::text); Such modifications are not supported. I don't see why we should cater for that. Yours, Laurenz Albe