Perhaps too late for OP, but might help others: why not do it by a batch file? I assume OP's situation and nullable
if "%1"=="" (
set /p %1= "Set path to the image:"
raster2pgsql -a -d tiff/field*.tiff -F %1 public.latest | psql -d my_db
if "%2"=="" (
set /p %2= "Set forecast date:"
psql -d my_db -c "UPDATE public.latest SET forecast_date = %2 WHERE forecast_date IS NULL;"
@echo off should remove unnecessary noise (printing the code)
setlocal is not mandatory, if you don't need to use more databases through the same command line; it would be very useful if you had set your password there; however, I assume you do it right and store your password in the .pgpass file
the "if" parts are there to allow you call the script both with and without parameters
my_db is your database
-a is important - this way you add to already established database; otherwise, you would have to replace the following SQL statement with the one jorgeas80 suggested
that pgsql statement contains SQL UPDATE. Watch out for badly imported rows, otherwise they would get the same date as the new raster; this could be improved, but I assume that this version suffices
pause causes the script to wait until you hit any key; useful if you run the script from anywhere but the command line
This is a result of a day or two of trying to solve roughly the same problem as the OP had; I can't confess I really understand command line, batch files, raster2pgsql and psql (I didn't know them at all before I started), so something might be done much better some other way. But this solution works, at least for me.