Re: untrusted languages and non-global superusers?

From: Richard Huxton <dev(at)archonet(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: Tino Wildenhain <tino(at)wildenhain(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: untrusted languages and non-global superusers?
Date: 2005-08-04 08:56:09
Message-ID: 42F1D829.2040209@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CSN wrote:
>>Why cant your application handle this?
>>Otoh, why dont you provide a function to send mail,
>>which takes some parameters and just let your users
>>use them? No need for everybody to write her own
>>mail function.
>
>
> Convenience! I want the email sent whether the member
> is added via the web interface, directly in the
> database, from the command line, etc. I don't see any
> downside. It's only one user that'll be using this
> function.

But it does mean that user is running code as the database user, so if
you don't trust them with that, don't do it.

What I use with this is a "message_queue" table and a cron-job that runs
once a minute (or every 5). It keeps the two processes separate (decide
to send a message and assemble the message and send it) and also lets
you get more complicated (in one example I need to build a report,
produce a PDF and then attach it to the email I generate).

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2005-08-04 09:08:19 Re: untrusted languages and non-global superusers?
Previous Message Teodor Sigaev 2005-08-04 08:46:42 Re: Tsearch2 doesn't work