"A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> writes:
> In response to Nacef LABIDI :
>> I want to write a function that takes as param a comma separated values string
>> and perform a select matching these values.
> Use EXECUTE sql_string,
Safer to use string_to_array, for instance
... WHERE id = ANY(string_to_array('1,3,7,8', ',')::int[]) ...
Of course this just begs the question of why the OP doesn't use an
array in the first place.
regards, tom lane