bucardo sync issue, function does not exist - postgresql

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

Related

BigSQL PostgreSQL CREATE EXTENSION errors

I have windows 8.1 and I want to try hadoop_fdw. Problem is with loading the extension with:
CREATE EXTENSION hadoop_fdw;
ddssdg
ERROR: could not load library "D:/PROGRA~2/POSTGR~2/pg95/../pg95/lib/postgresql/hadoop_fdw.dll": unknown error 126
********** Error **********
ERROR: could not load library "D:/PROGRA~2/POSTGR~2/pg95/../pg95/lib/postgresql/hadoop_fdw.dll": unknown error 126
SQL state: XX000
I tried to create extension manually from SQL located at "D:\Program Files\PostgreSQLBigsql\pg95\share\postgresql\extension"
CREATE FUNCTION hadoop_fdw_handler()
RETURNS fdw_handler
AS 'D:\Program Files\PostgreSQLBigsql\pg95\lib\postgresql\hadoop_fdw.dll'
LANGUAGE C STRICT;
CREATE FUNCTION hadoop_fdw_validator(text[], oid)
RETURNS void
AS 'D:\Program Files\PostgreSQLBigsql\pg95\lib\postgresql\hadoop_fdw.dll'
LANGUAGE C STRICT;
CREATE FOREIGN DATA WRAPPER hadoop_fdw
HANDLER hadoop_fdw_handler
VALIDATOR hadoop_fdw_validator;
I get this error same error again:
ERROR: could not load library "D:\Program Files\PostgreSQLBigsql\pg95\lib\postgresql\hadoop_fdw.dll": unknown error 126
********** Error **********
ERROR: could not load library "D:\Program Files\PostgreSQLBigsql\pg95\lib\postgresql\hadoop_fdw.dll": unknown error 126
SQL state: XX000
What I am doing wrong?
EDIT 1: So I found missing DLL's. They are:
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
JVM.DLL
I added them to C:\Windows\SysWOW64\ and extension still doesn't work - it probably requires restart.

Running Spatial Queries in PostGIS 2.1.3 and Postgresql 9.3 in Windows 7

I installed PostGreSql 9.3 ( PgAdmin 3 GUI) and PostGIS 2.1.3 (http://www.enterprisedb.com/products-services-training/pgdownload#windows) for Windows 7 64 bit.
After installing it, I downloaded the Sql files for country database (http://www.spatial.cs.umn.edu/Book/labs/vania/spatialQueries.html) and tried to execute the commands in Country.sql
in the Sql Builder and stuck at the following error:
NOTICE: SRID value -1 converted to the officially unknown SRID value 0
CONTEXT: SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6,$7)"
PL/pgSQL function addgeometrycolumn(character varying,character varying,character varying,integer,character varying,integer,boolean) line 5 at SQL statement
ERROR: function geometryfromtext(unknown, integer) does not exist
LINE 4: ...3000.0000','Dollar','USD','N','5','United States',GeometryFr...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
********** Error **********
ERROR: function geometryfromtext(unknown, integer) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 769
I can't get this error resolved. Please help me out.

Can't use pgRouting functions in PostgreSQL 9.2

I have 3 pgRouting sql files,
routing_core
routing_core_wrappers
routing_topology
And I run the code in the first one in PostgreSQL 9.2, I got this error,
PS. although there are already pgRouting functions in extensions of 9.2, I still can't run the following code,
ALTER TABLE tc_2000_w_area ADD COLUMN source integer;
ALTER TABLE tc_2000_w_area ADD COLUMN target integer;
SELECT assign_vertex_id('tc_2000_w_area', 0.0001, 'the_geom', 'gid')
got the error,
>>>
Traceback (most recent call last):
File "C:/Users/Heinz/Desktop/python_test/any_test.py", line 12, in <module>
cur.execute(query)
ProgrammingError: 錯誤: 函式 assign_vertex_id(unknown, numeric, unknown, unknown) 不存在
LINE 4: SELECT assign_vertex_id('tc_2000_w_area', 0.0001, 'the_g...
^
HINT: 沒有符合指定之名稱和參數型別的函式。您可能需要加入明確型別轉換。
So I think to run the above 3 sql files first.
But I can run all 3 sql files in PostgreSQL 8.4
I am working with PostgreSQL 9.2, PostgreSQL 8.4 under Windows 8.1 x64.
UPDATE#1
I run the code below, but shows error message,
create extension pgrouting;
錯誤: 擴充功能 "pgrouting" 已存在
********** 錯誤 **********
錯誤: 擴充功能 "pgrouting" 已存在
SQL 狀態: 42710
the error message means the pgRouting extension already exists, but if I directly use the code in my original post, got the same error as I posted.
You have to install postgis before pgrouting.
create extension postgis;
create extension pgrouting;
Then you should be able to use it.

syntax error for copy command in postgresql

I used the command:
COPY studentapp_deg_course_cat(degree_code, specialization, category_level1, category_level2, category_level3, min_credit, max_credit, primary)
FROM '/home/abhishek/Downloads/courses.csv'
USING DELIMITERS ';'
and i am getting the following error:
ERROR: syntax error at or near "COPY" LINE 1: COPY studentapp_deg_course_cat(degree_code, specialization,...
^
********** Error **********
ERROR: syntax error at or near "COPY" SQL state: 42601 Character: 1
I would like to know the error in my code
Valid COPY syntax for version 9.1 on Linux should be:
COPY studentapp_deg_course_cat(degree_code, specialization, category_level1,
category_level2, category_level3, min_credit, max_credit, "primary")
FROM '/home/abhishek/Downloads/courses.csv'
WITH (DELIMITER ';')
WITH, not USING.
DELIMITER instead of DELIMITERS.
And do not use primary as column name. It's a reserved word.

Syntax error postgresql

I have a syntax error on Postgresql:
The error :
ERROR: syntax error at or near "\"
LINE 19066: \.
^
********** Erreur **********
ERROR: syntax error at or near "\"
État SQL :42601
Caractère : 678313
And the offending line
COPY accesslog (aid, sid, title, path, url, hostname, uid, timer, "timestamp") FROM stdin;
\.
Do you have an idea what's wrong?
PgAdmin-III doesn't support interactive line-by-line COPY. Use psql.
That said, I think you are trying to COPY data FROM the server, not to it. If that's the case, either use COPY ... TO 'some-file-name' (a path relative to the database server), use pg_dump, or use psql with \copy.