Adding logic to insertEntryQuery method in Postgres database
implementation