pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Grant on lo_export()
3+ messages / 2 participants
[nested] [flat]

* Grant on lo_export()
@ 2018-08-01 11:12  Nelson Gonzaga <ngonzaga@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Nelson Gonzaga @ 2018-08-01 11:12 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Hi all,I'm trying to use lo_import / lo_export and apparently I have permission denied:

command:select lo_export(oid_imagem, '/tmp2/erro_export1.png') fromimagem where nome_imagem = 'erro';
ERROR: mustbe superuser to use server-side lo_export()SQL state:42501Hint:Anyone can use the client-side lo_export() provided by libpq.

It's okay when I enter the data as superuser like this:insert into image (image_name, oid_picture) values ('error1', lo_import ('/ tmp2 / erro.png'));
and the table:create table image (image_name varchar (20), oid_image oid);
I Use Linux Debian 7 and Postgresql 9.4
Any idea?

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Grant on lo_export()
@ 2018-08-01 14:06  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Nelson Gonzaga <ngonzaga@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-08-01 14:06 UTC (permalink / raw)
  To: Nelson Gonzaga <ngonzaga@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Nelson Gonzaga <ngonzaga@yahoo.com> writes:
> Hi all,I'm trying to use lo_import / lo_export and apparently I have permission denied:
> command:select lo_export(oid_imagem, '/tmp2/erro_export1.png') fromimagem where nome_imagem = '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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Grant on lo_export()
@ 2018-08-01 18:34  Nelson Gonzaga <ngonzaga@yahoo.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Nelson Gonzaga @ 2018-08-01 18:34 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

 I understand that I have to use libpq for the lo_import command to work.but I did not find .NET code to use this library.Is there an example? Or just this in C ++ [1]?
[1] https://www.postgresql.org/docs/current/static/lo-examplesect.html

    Em quarta-feira, 1 de agosto de 2018 11:06:43 BRT, Tom Lane <tgl@sss.pgh.pa.us> escreveu:  
 
 Nelson Gonzaga <ngonzaga@yahoo.com> writes:
> Hi all,I'm trying to use lo_import / lo_export and apparently I have permission denied:
> command:select lo_export(oid_imagem, '/tmp2/erro_export1.png') fromimagem where nome_imagem = '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
  

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-08-01 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 11:12 Grant on lo_export() Nelson Gonzaga <ngonzaga@yahoo.com>
2018-08-01 14:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-08-01 18:34   ` Nelson Gonzaga <ngonzaga@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox