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 1iFoNk-0000Z5-GE for pgsql-general@arkaria.postgresql.org; Wed, 02 Oct 2019 23:50:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFoNh-0004Zg-Ta for pgsql-general@arkaria.postgresql.org; Wed, 02 Oct 2019 23:50:05 +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 1iFoNh-0004ZS-Hj for pgsql-general@lists.postgresql.org; Wed, 02 Oct 2019 23:50:05 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFoNb-0006Xr-01 for pgsql-general@lists.postgresql.org; Wed, 02 Oct 2019 23:50:05 +0000 Received: by mail-pg1-x542.google.com with SMTP id z12so565291pgp.9 for ; Wed, 02 Oct 2019 16:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=U8NAxDfk/BDpso3YcLcQvOUtb0jT4BXetOUPfDmo8o8=; b=EYf0dkbqvgC7IQEF9jBb8xJ636X4ORCm6wEFVb6YQ4HlLJl8HbGmFHQBE489KChoiU ts6owH+M21jJaDTkA4CkovMX0y9hJIrMHWSm/+hV63GD8sPqRrKm7ZLNcW7MpAoxNZ70 L3WjqKUGhWX39BeVb1CWFlcSJlohl8efWapQw6R7zFt40tbZsVHW9RPbGV0cyVohr2BM Xh0XtVnH2TjpHtle3kSwe2DHz5J1yQN6IiPgxPrd4+8Qj+lvjcxgtlpTxai26pkEImyn LwJ+VpcEdaJgkh/jcbGN0mCp+VxGZNR6A9awrrPh/esJnABl5rIPv7Z6CjkYAOVExHlT HnNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=U8NAxDfk/BDpso3YcLcQvOUtb0jT4BXetOUPfDmo8o8=; b=NQ0uqKygUn8WzZdBSgL5iRIM61hSiwVSyQbwCmwss9asmMQlaX7bUywrMYA4RcTE6T KkOIHO40CpD0sNGYoKaCkjpiKHHGbZGJlZEQRDMfB7JlOwjFll3Kx+VwYM3wb07jyRks WBuVhSfo5Inw63o4ne1J9Mm97ZBNbO/MzYY4HrDzNgYz3Ks9+xFYiIx/KQcjKUhxgo88 1golLs0gYq5nWTzKtlR3Q1NvverwnPgNgcwXVKNi6bk3LYo5yTcu8cRAr88S3E69Gz6G gGcQNf/EmEEUFqgt3V1dxateKQS3xpf5rOlVOpbTtG7Iv1jogynMSko1x8iwey/5Bbw+ F7dA== X-Gm-Message-State: APjAAAXBDEKEv16vL2DNfqZpVo13DDK+RfBJ2grHIKVPkWOQHUhUMzIS cGr7/qiCKGE6U2z47yXEsDrZewIr X-Google-Smtp-Source: APXvYqxzMR9PSHQnRGq0lfBSDxtk1g1r1ccAJQyGU7Xb12yVGGHYac81DQmn6hPLsQCF9R8teerLKg== X-Received: by 2002:a63:5144:: with SMTP id r4mr6390696pgl.339.1570060194768; Wed, 02 Oct 2019 16:49:54 -0700 (PDT) Received: from [10.104.134.41] ([155.100.47.1]) by smtp.gmail.com with ESMTPSA id a8sm524049pfo.118.2019.10.02.16.49.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 16:49:54 -0700 (PDT) Subject: Re: Users, Roles and Connection Pooling To: pgsql-general@lists.postgresql.org References: <0503910ff326d635e681849565de20db63c63eca.camel@cybertec.at> <20191002232708.uhg6kqz7ftob7l4n@raf.org> From: Rob Sargent Message-ID: Date: Wed, 2 Oct 2019 17:49:51 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191002232708.uhg6kqz7ftob7l4n@raf.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/2/19 5:27 PM, raf wrote: >> > I can't help with questions about scale but I like to give roles/users > almost no permissions at all. i.e. They can't select, insert, update > or delete anything. All they have permission to do is to execute stored > functions that were installed by a role with the necessary permissions > and they are security defining functions so the permissions of the role > that created them apply when the functions are called. This means that > there will never be any successful SQL injection, even if the application > code is buggy, so it's more important for web applications, but I apply > this method to internal systems as well. This approach might help with > scaling because fewer users might be needed but I'm not sure. > > cheers, > raf > > How easy is it to introduce an new function call all the way up to the app user?  Does this approach preclude making use of any query generation techniques available?