How to fix currval is not yet defined in this session in PostgreSQL | DevErrors