0

I have this table

create table preñadas(
    hierro varchar(15) NOT NULL,
    hierro_toro varchar (30) NOT NULL,
    fecha_esperada_parto timestamp,
    observaciones varchar(200),
    primary key (hierro),
    foreign key (hierro) references animales,
    foreign key (hierro_toro) references animales (hierro)
);

i would like to eliminate a record automatically from it when now() is one month past fecha_esperada_parto

Any ideas how to do it?

  • A cron job that runs a `DELETE` statement. https://dba.stackexchange.com/q/43937/188406 – Bergi May 10 '20 at 15:23
  • Does this answer your question? [Event Scheduler in PostgreSQL?](https://stackoverflow.com/questions/6839469/event-scheduler-in-postgresql) – Bergi May 10 '20 at 15:25

0 Answers0