convert :type into integer for postgres