pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Hide function source
4+ messages / 4 participants
[nested] [flat]

* Hide function source
@ 2021-10-10 08:50  Nelson Gonzaga <ngonzaga@yahoo.com>
  0 siblings, 3 replies; 4+ messages in thread

From: Nelson Gonzaga @ 2021-10-10 08:50 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

Dear,How do I hide a function source code from all users except superuser, but all can execute it?Thanks,Nelson 

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

* Re: Hide function source
@ 2021-10-10 14:05  Pepe TD Vo <pepevo@yahoo.com>
  parent: Nelson Gonzaga <ngonzaga@yahoo.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Pepe TD Vo @ 2021-10-10 14:05 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>; Nelson Gonzaga <ngonzaga@yahoo.com>

you can grant execute privilege to the user(s)GRANT EXECUTE ON FUNCTION function_name() TO some_user;


Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love, and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

 

    On Sunday, October 10, 2021, 04:52:54 AM EDT, Nelson Gonzaga <ngonzaga@yahoo.com> wrote:  
 
 Dear,How do I hide a function source code from all users except superuser, but all can execute it?Thanks,Nelson   

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

* Re: Hide function source
@ 2021-10-10 14:08  Mladen Gogala <gogala.mladen@gmail.com>
  parent: Nelson Gonzaga <ngonzaga@yahoo.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Mladen Gogala @ 2021-10-10 14:08 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org


On 10/10/21 04:50, Nelson Gonzaga wrote:
> Dear,
> How do I hide a function source code from all users except superuser, 
> but all can execute it?
> Thanks,
> Nelson

That is not possible. Postgres doesn't store functions in the compiled 
form, it stores them in the source form. Each process that executes a 
function has to compile it first. If you are looking for something like 
the Oracle "wrap", it might exist as an extension, I don't know. Please 
be aware that even Oracle "wrap" is not very secure. There is a public 
SQL*Developer extension which unwraps the wrapped source code.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

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

* Re: Hide function source
@ 2021-10-11 07:40  hubert depesz lubaczewski <depesz@depesz.com>
  parent: Nelson Gonzaga <ngonzaga@yahoo.com>
  2 siblings, 0 replies; 4+ messages in thread

From: hubert depesz lubaczewski @ 2021-10-11 07:40 UTC (permalink / raw)
  To: Nelson Gonzaga <ngonzaga@yahoo.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sun, Oct 10, 2021 at 08:50:33AM +0000, Nelson Gonzaga wrote:
> Dear,How do I hide a function source code from all users except
> superuser, but all can execute it?Thanks,Nelson 

Write it in something else than sql or plpgsql, and use external file.

But, if your function source is security vulnerability, then don't write
it that way.

Best regards,

depesz






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


end of thread, other threads:[~2021-10-11 07:40 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-10 08:50 Hide function source Nelson Gonzaga <ngonzaga@yahoo.com>
2021-10-10 14:05 ` Pepe TD Vo <pepevo@yahoo.com>
2021-10-10 14:08 ` Mladen Gogala <gogala.mladen@gmail.com>
2021-10-11 07:40 ` hubert depesz lubaczewski <depesz@depesz.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