0

I have issues with adding database to sync. DB versions: PostgreSQL 9.6.8 (RDS), Jump system: Ubuntu18.04 LTS, bucardo version: 5.4.1.

When trying run this command:

bucardo add sync db_sync relgroup=copying_herd dbs=source_db:source,dest_db:target onetimecopy=1

I receive this error:

WARNING:  Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=dc_sourcedb;host=xxx.aaa.xyz;port=5432 at line 126.
Failed to add sync: DBD::Pg::st execute failed: ERROR:  DBD::Pg::db do failed: ERROR:  function search_string(text) does not exist
LINE 5:             array_agg(search_string(x)),
                              ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:
  SELECT
    coalesce(
        array_to_string(
            array_agg(search_string(x)),
            '|'
        )::text,
        ''
    )
  FROM unnest($1) x

CONTEXT:  SQL function "flatten_text_array" during inlining at line 126. at line 30.
CONTEXT:  PL/Perl function "validate_sync" at /usr/bin/bucardo line 4612.

Function search_string exist and I can run this function from psql command line

  • It probably depends on your `search_path` setting. Try adding explicit schema qualification to the function call. – Laurenz Albe Apr 02 '19 at 07:09
  • @LaurenzAlbe thank you for this post, but this query is called by bucardo, as I wrote in my last sentence running it manually from command line shows me correct reponse. `search_path` settings should be OK, because I adding all sequences, tables, etc from source db. – jozwior Apr 03 '19 at 08:34
  • Obviously the `search_path` setting is *not* ok, otherwise you wouldn't be seeing this error. You say "function", so I assume this is a function you defined, and you can fix it. If it is not, and the function was created by bucardo, I would file a bug with them. – Laurenz Albe Apr 03 '19 at 08:42
  • Thank you Laurenz for your tips. It's helped me with solve this issue! – jozwior Apr 08 '19 at 08:52

0 Answers0