ERROR: syntax error at or near "and" at character 222