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 1osxTX-0001Ij-6R for pgsql-admin@arkaria.postgresql.org; Thu, 10 Nov 2022 02:39:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1osxTW-0007Ow-1m for pgsql-admin@arkaria.postgresql.org; Thu, 10 Nov 2022 02:39:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osxTV-0007On-Mj for pgsql-admin@lists.postgresql.org; Thu, 10 Nov 2022 02:39:29 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osxTT-0005dv-LD for pgsql-admin@lists.postgresql.org; Thu, 10 Nov 2022 02:39:29 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4N75dP6BB0z9sNr; Thu, 10 Nov 2022 03:39:21 +0100 (CET) Date: Thu, 10 Nov 2022 03:39:20 +0100 (CET) From: Erik Wienhold To: Bo Victor Thomsen , pgsql-admin@lists.postgresql.org Message-ID: <695861386.480654.1668047960677@office.mailbox.org> In-Reply-To: <3b83b029-30c6-a0cc-2993-81910c1ee62b@gmail.com> References: <903563259.260181.1667842135503@office.mailbox.org> <4240dcf8-2226-15dc-3a0d-1fd76f8c38bc@gmail.com> <1581955070.282646.1667869831483@office.mailbox.org> <1103549459.284197.1667874591587@office.mailbox.org> <3b83b029-30c6-a0cc-2993-81910c1ee62b@gmail.com> Subject: Re: Allowing users to create objects in version controlled schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4N75dP6BB0z9sNr List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 08/11/2022 05:42 CET Bo Victor Thomsen w= rote: > > I am both (PostgreSQL) database and QGIS developer and occasionally a DB > admin.=C2=A0 From that point of view: > > There is a ton of use cases, where having a private schema for each QGIS > user makes sense. For example, GIS analysis will often create datasets > with limited lifetime, i.e being part of a process. These datasets has > to be stored somewhere. If it's not in a private schema, you'll have > them splattered out over your entire filesystems in different file-based > GIS formats, including some on the users local hard drive. > > Further, having even temporary data stored in your database gives the > user opportunity to off-load some heavy-duty GIS analysis to the > database using the PostGIS extension. Think of your database as a "file > system", a "scratch pad". > > This kind of work is fundamentally different from a traditional 3-tier > setup where your normal user probably is not even aware of the > underlying=C2=A0 data structure. And structure changes can be "hidden" in= the > business logic layer. > > > All schema definitions tables/views/etc are versioned using git in a st= ructured > > repository of flat sql files. It works well. Table defs etc get code re= viewed > > and deployed by more DB-minded engineers, > > This is a good idea. When some kind of analysis workflow is worked out / > stabilised , the resulting tables/views etc. can be quality-checked and > transferred to the "proper" database. > > You could establish a separate database (including -server ?) and let > QGIS users access the central database using Foreign Data Wrappers. Thanks a lot. I don't have my team mate's requirement yet so I can't say if private schem= as are an option. If those tables are used as layers, I assume they are meant= to be shared with other users. I think in that case it is also better to have= them manage privileges manually instead of automating that part as I've outlined= in my original post. It still gives me headaches when I think about users who may create objects= with dependencies on the versioned part of the schema. Those dependencies may p= revent migrations that alter dependent objects. But this can indeed be isolated v= ia FDW with some overhead to keep the schemas in sync. -- Erik