hi Paul > Any modern version of PHP which has pg_ specific functions can do it > like this: You are 100% right. My application had to run with PHP below 4.2 where pg_escape_bytea() was not yet defined. And it works also with higher PHP versions ;-) Conni