I need to send data via http protocol (GET or POST request) from the function or trigger. Is it possible?

share|improve this question
feedback

3 Answers

up vote 6 down vote accepted

You could try writing the trigger in PL/Python and use urllib2 to POST.

share|improve this answer
Hmm, it looks like a PL/Perl in untrusted mode (postgresql.org/docs/8.4/interactive/plperl-trusted.html)... Are there differences in the use of PL/Python and PL/Perl? Both of then must be runned in untrusted mode and thats all? This means that I can use the module IO::Socket or HTTP::Request without any limitations? – im4LF Jul 24 '10 at 17:37
Yes, that's all. – Frank Heikens Jul 24 '10 at 18:09
feedback

Any "untrusted" language with HTTP support can do this:

  • PL/Pythonu
  • PL/perlu
  • PL/javau
  • ...

but you shouldn't really do it. See Does PLV8 support making http calls to other servers? and why you shouldn't send email from a trigger function.

share|improve this answer
feedback

There is an extension to do this, use with caution.

pgsql-http

share|improve this answer
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.