Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkrlY-00039J-Oz for pgsql-admin@arkaria.postgresql.org; Wed, 01 Aug 2018 14:06:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkrlX-0007EB-2b for pgsql-admin@arkaria.postgresql.org; Wed, 01 Aug 2018 14:06:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkrlW-0007E4-Nn for pgsql-admin@lists.postgresql.org; Wed, 01 Aug 2018 14:06:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkrlQ-0006zQ-6o for pgsql-admin@lists.postgresql.org; Wed, 01 Aug 2018 14:06:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w71E66a7027171; Wed, 1 Aug 2018 10:06:06 -0400 From: Tom Lane To: Nelson Gonzaga cc: "pgsql-admin@lists.postgresql.org" Subject: Re: Grant on lo_export() In-reply-to: <1160328940.343057.1533121961953@mail.yahoo.com> References: <1160328940.343057.1533121961953.ref@mail.yahoo.com> <1160328940.343057.1533121961953@mail.yahoo.com> Comments: In-reply-to Nelson Gonzaga message dated "Wed, 01 Aug 2018 11:12:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27169.1533132366.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 01 Aug 2018 10:06:06 -0400 Message-ID: <27170.1533132366@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Nelson Gonzaga writes: > Hi all,I'm trying to use lo_import / lo_export and apparently I have per= mission denied: > command:select lo_export(oid_imagem, '/tmp2/erro_export1.png') fromimage= m where nome_imagem =3D 'erro'; > ERROR: must be superuser to use server-side lo_export() > SQL state:42501 > Hint:Anyone can use the client-side lo_export() provided by libpq. The error message means exactly what it says. As of v11 it'll be possible to grant usage of lo_export() to non-superusers, but in all released branches that check is hard-wired. Note that since you can use that function to overwrite PG data or config files, granting use of it to someone you wouldn't trust with full superuser would be a damfool idea anyway. regards, tom lane