How to execute a system file in procedure?

Поиск
Список
Период
Сортировка
Искать

How to execute a system file in procedure?

От:
Raymond Chui <raymond.chui@noaa.gov>
Дата:
I would like execute a system command or my program or my shell
script in procedure. How do I do that?
For example,

CREATE FUNCTION myname() RETURN OPAQUE AS '
    BEGIN
        IF count(NEW.aColumn) >= 600
        THEN RAISE EXCEPTION ''Hello, it is time to re-index the
table.'';
        END IF;
        RETURN NEW;
    END; '
LANGUAGE 'plpgsql';

CREATE TRIGGER AFTER INSERT OR UPDATE ON mytable
FOR EACH ROW EXECUTE PROCEDURE myname();

But I prefer to execute a system command like mail

mail -s "Re-Index" system@host.domain < `echo "It is time to re-index
the table"`


Re: How to execute a system file in procedure?

От:
"Albert REINER" <areiner@tph.tuwien.ac.at>
Дата:
On Mon, Aug 20, 2001 at 10:08:36AM -0400, Raymond Chui wrote:
> I would like execute a system command or my program or my shell
> script in procedure. How do I do that?

use .

Albert.


FAQ