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 1osGRT-0001A6-Aq for pgsql-admin@arkaria.postgresql.org; Tue, 08 Nov 2022 04:42: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 1osGRQ-0006Yh-Vb for pgsql-admin@arkaria.postgresql.org; Tue, 08 Nov 2022 04:42:28 +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 1osGRQ-0006Wl-Hl for pgsql-admin@lists.postgresql.org; Tue, 08 Nov 2022 04:42:28 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1osGRL-0000HH-0K for pgsql-admin@lists.postgresql.org; Tue, 08 Nov 2022 04:42:27 +0000 Received: by mail-ej1-x629.google.com with SMTP id f27so35558599eje.1 for ; Mon, 07 Nov 2022 20:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GtaJe9L/66z5EYqVtjNdlCyh3BuP3iJlWjvhMHHBad0=; b=IrDchRr4nzk6cdnRmkiaRB77xTZMbDueswgGVDBeqDJzuvtriJoUYCiZm/u6L+BTjv 6UyKysvlb8Shm6+Mp9rQQZqdLqn70f7lbcPSHW/Na/u//gmMrGbobRFdGJnpz7Hbrwdu Kt+JiIOSSUBo2Ymdhj17zS4BIFBnOrRRuDII440qHbB3GUOn8EdMgOa0s52yRJ/ijABh pdfhrsHnJ6ZYS4d47rpXX2n9PeokRpuRvkGfmrtbDopJ07IZS00/qFE2nVedHg6czrR4 fpKQ3R2rLLk5uF+7doMu1wxNSXGdNRNBNR4/HZ05pn+8M/iUFo+QA+1hpk6USefUAFzr 8iKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GtaJe9L/66z5EYqVtjNdlCyh3BuP3iJlWjvhMHHBad0=; b=yl/h7iEf6B2KS12Ck+r+oTDBXQGji0vAsFqfcJwFaEdqwabfFgG5VxPvoBDE/324tH reNbRxQrshwqX2yC1xRcD4GL1LywCVprGv8gFZD3ywpo24plr1xgRdI+4tI45o355HQV 7MfHwggFe5Ly2fEO4lC1ZsT0mHVyee6tkqg6wgHobcfEBT+gCY8Y9PBUCTSBcYmq3laj P2C2TJu5hdFKCsiD/l6ISQyLLvYwefm5xLkN+RktVVJ99p53W3pmWQnVeKZ8JOjSPvZJ BNWVGcIiBwEOqaAolDm76Kr4lw0fmokAF5uwGpiamBrveROB8DPWRNktG/Z82z3tAe9J BOwg== X-Gm-Message-State: ACrzQf19kktLgNluCmRgwpDsUjNTskMDf1BxxCQ/eVP+bEx2HGL4RU14 bLx1ECcEBXj/toiqWBqs/yHlgRI79M4kIQ== X-Google-Smtp-Source: AMsMyM7IpXg9PzpxmON4S7Jnd8trs/8fj23L4czN+9Ri97l0RGzGW4xyNHyrwdTBlcJ/Gyp6ATc0dA== X-Received: by 2002:a17:907:80d:b0:73d:a576:dfbd with SMTP id wv13-20020a170907080d00b0073da576dfbdmr50946270ejb.402.1667882541328; Mon, 07 Nov 2022 20:42:21 -0800 (PST) Received: from [10.0.0.13] (094145002074.dynamic.telenor.dk. [94.145.2.74]) by smtp.gmail.com with ESMTPSA id q13-20020a1709060e4d00b007415f8ffcbbsm4208864eji.98.2022.11.07.20.42.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 20:42:20 -0800 (PST) Message-ID: <3b83b029-30c6-a0cc-2993-81910c1ee62b@gmail.com> Date: Tue, 8 Nov 2022 05:42:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: Allowing users to create objects in version controlled schema Content-Language: en-GB To: pgsql-admin@lists.postgresql.org 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> From: Bo Victor Thomsen In-Reply-To: <1103549459.284197.1667874591587@office.mailbox.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Eric - I am both (PostgreSQL) database and QGIS developer and occasionally a DB admin.  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  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 structured > repository of flat sql files. It works well. Table defs etc get code reviewed > 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. Med venlig hilsen / Best regards Bo Victor Thomsen Den 08-11-2022 kl. 03:29 skrev Erik Wienhold: >> On 08/11/2022 02:19 CET Wells Oliver wrote: >> >> Feels like more of a process question and less of a technical postgres >> question. > You're right. But I'm wondering what's possible on the technical front. > >> In our world, each DB user has their own schema they have full access to, and >> can grant privileges as required. > Right, the standard approach with search_path = "$user". > >> All schema definitions tables/views/etc are versioned using git in a structured >> repository of flat sql files. It works well. Table defs etc get code reviewed >> and deployed by more DB-minded engineers, > That's what I meant with version controlled migrations. And I actually don't > want users to bypass that process to create and reference their own database > structures when those structures should rather be part of the common application > schema. > >> and people are cognizant of writing optimized SQL. > That's where I have my doubts when it comes to inexperienced "devs" and no > guiding code reviews. > > -- > Erik > >