From: | Christophe Garault <christophe(at)garault(dot)org> |
---|---|
To: | Liste PostgreSQL Fr <pgsql-fr-generale(at)postgresql(dot)org> |
Subject: | Fonction en Perl |
Date: | 2005-05-02 14:49:51 |
Message-ID: | 42763E0F.8030806@garault.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-fr-generale |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bonjour,
Ci-dessous le code d'une petite fonction en Perl que je n'arrive pas à
faire fonctionner:
CREATE FUNCTION udf_mail (text, text, text) RETURNS integer AS $$
use MIME::Lite;
my ($dest,$subj,$data) = @_;
$msg = MIME::Lite->new(
From => 'dba(at)garault(dot)com',
To => $dest,
Subject => $subj,
Data => $data
);
$msg->send;
return 1;
$$ LANGUAGE plperlu;
Voici le résultat:
syslog=# select * from udf_mail('sms(at)chezmoi(dot)com', 'Test', 'blah blah
blah');
ERREUR: La valeur du tableau doit commencer avec <<{>> ou avec
l'information de la dimension
Ce code marche très bien depuis Perl mais je tourne en rond en
essayant de le lançer depuis PostgreSQL 8.0.2
L'un d'entre-vous aurait-il une piste à me donner?
Merci d'avance.
- --
Christophe Garault
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCdj4PJ5Nh3YMYAQsRAsXwAJ97/c6D5P06J2VTqOzMKtN/jpnwmgCfdE5v
JYXOu4N5pcglS0ng8AXY4hI=
=AFXu
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Christophe Garault | 2005-05-02 18:47:37 | Re: Fonction en Perl |
Previous Message | Frédéric Turpin | 2005-05-02 09:32:29 | Re: Problème de temps |