addslashes() has been deprecated in favor of pg_escape_string() when using postgresql 8.3, since the quoting syntax has changed in 8.3. Current versions give rise to the following warnings in postres log:
WARNING: nonstandard use of \\ in a string literal at character 54