Q:

Triggers on change date

I'm trying to create some triggers in my db.
Now I need to create a trigger that "fire" a procedure when the date have changed. It's a Db for the management of a Bank. 
I need some procedure that start at a programmed date. For example, if I want to set an operation of accredit for the 24/05/2014, this procedure starts only when the current date is equal to the specified value.
I have read that there are some "scheduler" that can help me, but I don't know how to use them! (I'm using phpPgAdmin) There's something that I can do without setting some scheduled procedure? Only using a trigger?
this is my (wrong) trigger
CREATE TRIGGER programmata 
    AFTER INSERT ON transazione 
    FOR EACH ROW 
    EXECUTE PROCEDURE trans_programmata();

and this is the (wrong) procedure "trans_programmata()"
DECLARE
   p bit := 0;
BEGIN
   IF(new.programmata = p)THEN
     PERFORM * FROM aggiorna_conto();
   ELSE 
      IF new.data >= current_date THEN 
          PERFORM * FROM aggiorna_conto();
      END IF;
  END IF;
  RETURN NULL;
END;

Here is the table "transazione"
CREATE TABLE transazione (
    id integer NOT NULL,
    data date NOT NULL,
    tipo bit(1) NOT NULL,
    ammontare numeric(11,2) NOT NULL,
    programmata bit(1) NOT NULL,
    descrizione character varying(50) NOT NULL,
    fk_conto integer NOT NULL,
    fk_utente character(16) NOT NULL,
    fk_categoria character varying(20) NOT NULL
);

obviously, this way the trigger only "fires" when the inserted value of "data" is equal to the current date.

A:

Triggers (or event triggers in pg 9.3+) only fire on defined data events. What you are talking about is a scheduled (time-based) event. There is nothing built into Postgres for that.
I generally use cron jobs to schedule jobs like this.
There is also pgAgent, which used to be packaged with pgAdmin. (From pgAdmin v1.9 onwards, pgAgent is shipped as a separate application.)

