/* invalid foreign server option 'foo' ins't a valid endpoint URL */ CREATE SERVER rdfserver_error1 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint 'foo' ); ERROR: invalid endpoint: 'foo' /* empty foreign server option empty endpoints are not allowed */ CREATE SERVER rdfserver_error2 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint '' ); ERROR: empty value in option 'endpoint' /* invalid enable_pushdown value */ CREATE SERVER rdfserver_error3 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint 'https://dbpedia.org/sparql', enable_pushdown 'foo' ); ERROR: invalid enable_pushdown: 'foo' HINT: this parameter expects boolean values ('true' or 'false') /* invalid fetch_size nevative fetch_size */ CREATE SERVER rdfserver_error4 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint 'https://dbpedia.org/sparql', fetch_size '-1' ); ERROR: invalid fetch_size: '-1' HINT: expected values are positive integers /* invalid fetch_size empty string */ CREATE SERVER rdfserver_error5 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint 'https://dbpedia.org/sparql', fetch_size '' ); ERROR: empty value in option 'fetch_size' CREATE SERVER testserver FOREIGN DATA WRAPPER rdf_fdw OPTIONS (endpoint 'https://dbpedia.org/sparql'); /* invalid colum option OPTION 'foo' does not exist */ CREATE FOREIGN TABLE table_error1 ( name text OPTIONS (foo '?s') ) SERVER testserver OPTIONS (sparql 'SELECT * WHERE {?s ?p ?o}'); ERROR: invalid rdf_fdw option 'foo' /* empty colum option the column OPTION 'variable' cannot be empty. */ CREATE FOREIGN TABLE table_error2 ( name text OPTIONS (variable '') ) SERVER testserver OPTIONS (sparql 'SELECT * WHERE {?s ?p ?o}'); ERROR: empty value in option 'variable' /* invalid foreign table option SERVER option 'foo' does not exist. */ CREATE FOREIGN TABLE table_error3 ( name text OPTIONS (variable '?s') ) SERVER testserver OPTIONS (foo 'SELECT * WHERE {?s ?p ?o}'); ERROR: invalid rdf_fdw option 'foo' /* invalid foreign table option SPARQL variable '?foo' does not exist in the SPARQL query. the query will return only empty rows. */ CREATE FOREIGN TABLE table_error4 ( name text OPTIONS (variable '?foo') ) SERVER testserver OPTIONS (log_sparql 'true', sparql 'SELECT * WHERE {?s ?p ?o}'); SELECT * FROM table_error4 LIMIT 3; INFO: SPARQL query sent to 'https://dbpedia.org/sparql': SELECT ?foo {?s ?p ?o} LIMIT 3 name ------ (3 rows) /* invalid foreign table option log_sparql must be boolean */ CREATE FOREIGN TABLE table_error5 ( name text OPTIONS (variable '?s') ) SERVER testserver OPTIONS (sparql 'SELECT * WHERE {?s ?p ?o}', log_sparql 'foo'); ERROR: invalid log_sparql: 'foo' HINT: this parameter expects boolean values ('true' or 'false') /* INSERT, UPDATE and DELETE not supported */ CREATE SERVER testserver2 FOREIGN DATA WRAPPER rdf_fdw OPTIONS ( endpoint 'https://dbpedia.org/sparql' ); CREATE FOREIGN TABLE t1 ( name text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s WHERE {?s ?p ?o} LIMIT 1', log_sparql 'true'); INSERT INTO t1 (name) VALUES ('foo'); ERROR: cannot insert into foreign table "t1" UPDATE t1 SET name = 'foo'; ERROR: cannot update foreign table "t1" DELETE FROM t1; ERROR: cannot delete from foreign table "t1" /* EXPLAIN isn't supported*/ EXPLAIN SELECT * FROM t1; QUERY PLAN ------------------------------------------------------------------ Foreign Scan on t1 (cost=10000.00..20000.00 rows=1000 width=32) (1 row) CREATE TABLE public.t1_local(id serial, c1_null text, c2_null text); CREATE TABLE public.t2_local(name text, foo text); /* ordinary table instead of foreign table in 'foreign_table' */ CALL rdf_fdw_clone_table( foreign_table => 't1_local', target_table => 't2_local' ); ERROR: invalid relation: 't1_local' is not a foreign table /* foreign table instead of an ordinary table in 'target_table' */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1' ); ERROR: invalid relation: 't1' is not a table /* empty target_table */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => '' ); ERROR: no 'target_table' provided /* empty foreign_table */ CALL rdf_fdw_clone_table( foreign_table => '', target_table => 't1_local' ); ERROR: no 'foreign_table' provided /* negative fetch_size */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', fetch_size => -1 ); ERROR: invalid 'fetch_size': -1 HINT: the page size corresponds to the number of records that are retrieved after each iteration and therefore must be a positive number /* negative begin_offset */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => -1 ); ERROR: invalid 'begin_offset': -1 /* invalid ordering_column */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't2_local', orderby_column => 'foo' ); ERROR: invalid 'ordering_column': foo HINT: the column 'foo' does not exist in the foreign table 't1' /* target table does not match any column of t1 */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local' ); ERROR: target table mismatch HINT: at least one column of 't1_local' must match with the FOREIGN TABLE 't1' /* invalid sort_order */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', sort_order => 'foo' ); ERROR: invalid 'sort_order': foo HINT: the 'sort_order' must be either 'ASC' (ascending) or 'DESC' (descending) /* NULL foreign_table */ CALL rdf_fdw_clone_table( foreign_table => NULL, target_table => 't1_local'); ERROR: 'foreign_table' cannot be NULL /* NULL target_table */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => NULL); ERROR: 'target_table' cannot be NULL /* NULL begin_offset */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => NULL); ERROR: 'begin_offset' cannot be NULL HINT: either set it to 0 or ignore the paramter to start the pagination from the beginning /* NULL fetch_size */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => NULL); ERROR: 'fetch_size' cannot be NULL /* NULL max_records */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => 8, max_records => NULL); ERROR: 'max_records' cannot be NULL /* NULL sort_order */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => 8, max_records => 103, orderby_column => 'foo', sort_order => NULL); ERROR: 'sort_order' cannot be NULL /* NULL create_table */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => 8, max_records => 103, orderby_column => 'foo', sort_order => 'DESC', create_table => NULL); ERROR: 'create_table' cannot be NULL /* NULL verbose */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => 8, max_records => 103, orderby_column => 'foo', sort_order => 'DESC', create_table => true, verbose => NULL); ERROR: 'verbose' cannot be NULL /* NULL commit_page */ CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 't1_local', begin_offset => 42, fetch_size => 8, max_records => 103, orderby_column => 'foo', sort_order => 'DESC', create_table => true, verbose => false, commit_page => NULL); ERROR: 'commit_page' cannot be NULL /* invalid relation. an existing sequence is used instead of a relation on 'target_table', so the oid retrieval will not fail. it has to check if the oid corresponds to a relation and throw an error otherwise. */ CREATE SEQUENCE seq1; CALL rdf_fdw_clone_table( foreign_table => 't1', target_table => 'seq1' ); ERROR: invalid relation: 'seq1' is not a table /* invalid SPARQL - missing closing curly braces (\n)*/ CREATE FOREIGN TABLE t2 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql ' SELECT ?s {?s ?p ?o '); ERROR: unable to parse SPARQL WHERE clause: SELECT ?s {?s ?p ?o HINT: The WHERE clause expects at least one triple pattern wrapped by curly braces, e.g. '{?s ?p ?o}' /* invalid SPARQL - missing closing curly braces */ CREATE FOREIGN TABLE t3 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o'); ERROR: unable to parse SPARQL WHERE clause: SELECT ?s {?s ?p ?o HINT: The WHERE clause expects at least one triple pattern wrapped by curly braces, e.g. '{?s ?p ?o}' /* invalid SPARQL - missing closing curly braces (\t) */ CREATE FOREIGN TABLE t4 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql ' SELECT ?s {?s ?p ?o'); ERROR: unable to parse SPARQL WHERE clause: SELECT ?s {?s ?p ?o HINT: The WHERE clause expects at least one triple pattern wrapped by curly braces, e.g. '{?s ?p ?o}' /* invalid SPARQL - missing opening curly braces (\n)*/ CREATE FOREIGN TABLE t5 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql ' SELECT ?s ?s ?p ?o}'); ERROR: unable to parse SPARQL WHERE clause: SELECT ?s ?s ?p ?o} HINT: The WHERE clause expects at least one triple pattern wrapped by curly braces, e.g. '{?s ?p ?o}' /* empty WHERE clause */ CREATE FOREIGN TABLE t6 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {}'); SELECT * FROM t6; s --- (1 row) /* missing SELECT */ CREATE FOREIGN TABLE t7 (s text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql '?s {?s ?p ?o}'); ERROR: unable to parse SPARQL SELECT clause: ?s {?s ?p ?o}. /* empty nodetype */ CREATE FOREIGN TABLE t7 (s text OPTIONS (variable '?s', nodetype '') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: empty value in option 'nodetype' /* invalid nodetype */ CREATE FOREIGN TABLE t7 (s text OPTIONS (variable '?s', nodetype 'foo') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid nodetype: 'foo' HINT: this parameter expects node types ('iri' or 'literal') /* invalid literaltype - contains whitespaces */ CREATE FOREIGN TABLE t7 (s text OPTIONS (variable '?s', literaltype ' xsd:string') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid literaltype: ' xsd:string' HINT: whitespaces are not allwoed in 'literaltype' option /* invalid language - contains whitespaces */ CREATE FOREIGN TABLE t7 (s text OPTIONS (variable '?s', language 'de ') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid language: 'de ' HINT: whitespaces are not allwoed in 'language' option /* invalid combination of 'literaltype' and 'language' */ CREATE FOREIGN TABLE t8 (s text OPTIONS (variable '?s', literaltype 'iri', language 'es') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid language: 'es' HINT: the parameters 'literaltype' and 'language' cannot be combined /* invalid 'variable' */ CREATE FOREIGN TABLE t9 (s text OPTIONS (variable 's', expression 'now()') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid variable: 's' HINT: a query variable must start with either "?" or "$"; the "?" or "$" is not part of the variable name. Allowable characters for the name are [a-z], [A-Z], [0-9], _ and diacrictics. /* invalid 'variable' */ CREATE FOREIGN TABLE t10 (s text OPTIONS (variable '?a-z', expression 'now()') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid variable: '?a-z' HINT: a query variable must start with either "?" or "$"; the "?" or "$" is not part of the variable name. Allowable characters for the name are [a-z], [A-Z], [0-9], _ and diacrictics. /* invalid 'variable' */ CREATE FOREIGN TABLE t11 (s text OPTIONS (variable '?a$z', expression 'now()') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid variable: '?a$z' HINT: a query variable must start with either "?" or "$"; the "?" or "$" is not part of the variable name. Allowable characters for the name are [a-z], [A-Z], [0-9], _ and diacrictics. /* invalid 'variable' */ CREATE FOREIGN TABLE t12 (s text OPTIONS (variable '?a?z', expression 'now()') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid variable: '?a?z' HINT: a query variable must start with either "?" or "$"; the "?" or "$" is not part of the variable name. Allowable characters for the name are [a-z], [A-Z], [0-9], _ and diacrictics. /* invalid 'variable' */ CREATE FOREIGN TABLE t13 (s text OPTIONS (variable ' ?a', expression 'now()') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}'); ERROR: invalid variable: ' ?a' HINT: a query variable must start with either "?" or "$"; the "?" or "$" is not part of the variable name. Allowable characters for the name are [a-z], [A-Z], [0-9], _ and diacrictics. /* invalid foreign table option fetch_size empty */ CREATE FOREIGN TABLE t14 ( name text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}', fetch_size ''); ERROR: empty value in option 'fetch_size' /* invalid foreign table option fetch_size negative */ CREATE FOREIGN TABLE t15 ( name text OPTIONS (variable '?s') ) SERVER testserver2 OPTIONS (sparql 'SELECT ?s {?s ?p ?o}', fetch_size '-1'); ERROR: invalid fetch_size: '-1' HINT: expected values are positive integers DROP SEQUENCE seq1; DROP FOREIGN TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1_local, t2_local;