Postgresql Check If Column Is Empty In Javascript