Karthikeyan Sundaram <skarthi98@xxxxxxxxxxx> writes: > I am getting an error message > ERROR: function substr(bit, integer, integer) does not existHINT: No func= > tion matches the given name and argument types. You may need to add explici= > t type casts.CONTEXT: SQL function "week_func" I think you want substring() not substr(). regards, tom lane