I’m developing a Cinema Database in PostgreSQL. I have a Trigger which, before I insert a new show, checks if the date of the show is prior the movie’s release date (for example, adding today a show of Avatar 2). Here’s the code: Thing is, if the SHOWS table is empty, var1 is NULL. Already checked with a ‘raise notice’.