\set VERBOSITY terse SET client_min_messages TO DEBUG1; CREATE SERVER oai_server_dnb FOREIGN DATA WRAPPER oai_fdw OPTIONS (url 'https://services.dnb.de/oai/repository', request_redirect 'true', request_max_redirect '1'); SELECT OAI_Version() IS NULL; ?column? ---------- f (1 row) SELECT * FROM OAI_ListMetadataFormats('oai_server_ulb') ORDER BY metadataprefix COLLATE "C"; DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=ListMetadataFormats" DEBUG: HTTP 200, 1853 bytes metadataprefix | schema | metadatanamespace ----------------+--------------------------------------------------------------------+--------------------------------------------- arcmets | http://www.loc.gov/standards/mets/mets.xsd | http://www.loc.gov/METS/ epicur | http://www.persistent-identifier.de/xepicur/version1.0/xepicur.xsd | urn:nbn:de:1111-2004033116 marcexport | http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd | http://www.loc.gov/MARC21/slim mets | http://www.loc.gov/standards/mets/mets.xsd | http://www.loc.gov/METS/ mods | http://www.loc.gov/standards/mods/v3/mods-3-0.xsd | http://www.loc.gov/mods/v3 oai_dc | http://www.openarchives.org/OAI/2.0/oai_dc.xsd | http://www.openarchives.org/OAI/2.0/oai_dc/ rawmods | http://www.loc.gov/standards/mods/v3/mods-3-0.xsd | http://www.loc.gov/mods/v3 (7 rows) SELECT * FROM OAI_ListMetadataFormats('oai_server_dnb') ORDER BY metadataprefix COLLATE "C"; DEBUG: GET "https://services.dnb.de/oai/repository?verb=ListMetadataFormats" DEBUG: HTTP 200, 4186 bytes metadataprefix | schema | metadatanamespace ------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------- BibframeRDFxml | http://www.w3.org/2000/07/rdf.xsd | http://www.w3.org/1999/02/22-rdf-syntax-ns DDEX-xml | http://ddex.net/xml/ern/42/release-notification.xsd | http://ddex.net/xml/ern/42 JATS-xml | http://jats.nlm.nih.gov/publishing/1.0/xsd/JATS-journalpublishing.xsd | http://jats.nlm.nih.gov/publishing/1.0 MARC21-xml | http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd | http://www.loc.gov/MARC21/slim MARC21plus-1-xml | http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd | http://www.loc.gov/MARC21/slim MARC21plus-xml | http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd | http://www.ddb.de/professionell/MARC21/plus ONIX-xml | http://www.editeur.org/onix/2.1/short/ONIX_BookProduct_Release2.1_short.xsd | http://www.editeur.org/onix/2.1/short/ONIX_BookProduct_Release2.1_short PicaPlus-xml | http://www.oclcpica.org/xmlns/ppxml-1.0.xsd | http://www.oclcpica.org/xmlns/ppxml-1.0 RDFprov-xml | http://www.w3.org/2000/07/rdf.xsd | http://www.w3.org/1999/02/22-rdf-syntax-ns RDFprovPlus-xml | http://www.w3.org/2000/07/rdf.xsd | http://www.w3.org/1999/02/22-rdf-syntax-ns RDFxml | http://www.w3.org/2000/07/rdf.xsd | http://www.w3.org/1999/02/22-rdf-syntax-ns baseDc-xml | http://oai.base-search.net/base_dc/base_dc.xsd | http://oai.base-search.net/base_dc crossref-xml | https://www.crossref.org/schema/crossref4.4.0.xsd | http://www.crossref.org/schema/4.4.0 mods-xml | http://www.loc.gov/standards/mods/v3/mods-3-6.xsd | http://www.loc.gov/mods/v3 oai_dc | http://www.openarchives.org/OAI/2.0/oai_dc.xsd | http://www.openarchives.org/OAI/2.0/oai_dc sync-repo-xml | http://files.dnb.de/standards/formate/syncrepo.xsd | http://www.d-nb.de/schemas/syncrepo xMetaDiss | http://www.d-nb.de/standards/xmetadiss/xmetadiss.xsd | http://www.d-nb.de/standards/xMetaDiss/ (17 rows) SELECT * FROM OAI_ListSets('oai_server_ulb') WHERE setname IS NOT NULL AND setspec IS NOT NULL ORDER BY setname COLLATE "C" FETCH FIRST ROW ONLY; DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=ListSets" DEBUG: HTTP 200, 1386 bytes DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=ListSets&resumptionToken=cursor_p_3D10_p_26batch_size_p_3D11" DEBUG: HTTP 200, 1303 bytes DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=ListSets&resumptionToken=cursor_p_3D20_p_26batch_size_p_3D11" DEBUG: HTTP 200, 1420 bytes DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=ListSets&resumptionToken=cursor_p_3D30_p_26batch_size_p_3D11" DEBUG: HTTP 200, 1017 bytes setspec | setname ---------+--------- benelux | Benelux (1 row) SELECT * FROM OAI_ListSets('oai_server_dnb') WHERE setname IS NOT NULL AND setspec IS NOT NULL ORDER BY setname COLLATE "C" FETCH FIRST ROW ONLY; DEBUG: GET "https://services.dnb.de/oai/repository?verb=ListSets" DEBUG: HTTP 200, 800458 bytes setspec | setname -----------------+-------------------------------------------- authorities:dif | Bestand Deutsches Filminstitut (DIF e. V.) (1 row) SELECT count(*) > 0 FROM OAI_ListSets('oai_server_dnb') WHERE setname IS NOT NULL AND setspec IS NOT NULL; DEBUG: GET "https://services.dnb.de/oai/repository?verb=ListSets" DEBUG: HTTP 200, 800458 bytes ?column? ---------- t (1 row) SELECT * FROM OAI_Identify('oai_server_ulb') ORDER BY name COLLATE "C"; DEBUG: GET "https://sammlungen.ulb.uni-muenster.de/oai?verb=Identify" DEBUG: HTTP 200, 760 bytes name | description -------------------+---------------------------------------------------------------------- adminEmail | vl-support@semantics.de baseURL | http://sammlungen.ulb.uni-muenster.de/oai/ deletedRecord | no earliestDatestamp | 2011-02-22T15:12:26Z granularity | YYYY-MM-DDThh:mm:ssZ protocolVersion | 2.0 repositoryName | Visual Library Server der Universitäts- und Landesbibliothek Münster (7 rows) SELECT * FROM OAI_Identify('oai_server_dnb') ORDER BY name COLLATE "C"; DEBUG: GET "https://services.dnb.de/oai/repository?verb=Identify" DEBUG: HTTP 200, 779 bytes name | description -------------------+------------------------------------------------------- adminEmail | oai-repository@dnb.de baseURL | https://services.dnb.de/oai/repository deletedRecord | transient earliestDatestamp | 1945-01-01T00:00:00Z granularity | YYYY-MM-DDThh:mm:ssZ protocolVersion | 2.0 repositoryName | OAI-Repository of the German National Library V2.0.11 (7 rows) -- Test oai_fdw_version() returns a non-empty string SELECT length(oai_fdw_version()) > 0 AS version_exists; version_exists ---------------- t (1 row) -- Test oai_fdw_version() contains expected components SELECT oai_fdw_version() ~ 'oai_fdw\s+[0-9]+\.[0-9]+' AS has_oai_fdw_version, oai_fdw_version() ~ 'PostgreSQL\s+[0-9]+' AS has_postgresql_version, oai_fdw_version() ~ 'libxml\s+[0-9]+\.[0-9]+' AS has_libxml_version, oai_fdw_version() ~ 'libcurl\s+[0-9]+\.[0-9]+' AS has_libcurl_version; has_oai_fdw_version | has_postgresql_version | has_libxml_version | has_libcurl_version ---------------------+------------------------+--------------------+--------------------- t | t | t | t (1 row) -- Test oai_fdw_settings() C function returns a non-empty string SELECT length(oai_fdw_settings()) > 0 AS settings_exists; settings_exists ----------------- t (1 row) -- Test oai_fdw_settings() C function contains expected core components SELECT oai_fdw_settings() ~ 'oai_fdw\s+[0-9]+\.[0-9]+' AS has_oai_fdw, oai_fdw_settings() ~ 'PostgreSQL\s+[0-9]+' AS has_postgresql, oai_fdw_settings() ~ 'libxml\s+[0-9]+\.[0-9]+' AS has_libxml, oai_fdw_settings() ~ 'libcurl\s+[0-9]+\.[0-9]+' AS has_libcurl; has_oai_fdw | has_postgresql | has_libxml | has_libcurl -------------+----------------+------------+------------- t | t | t | t (1 row) -- Test oai_fdw_settings view returns expected components. ssl, zlib, -- libSSH and nghttp2 are only listed when libcurl was built with them. SELECT component, version IS NOT NULL AS has_version FROM oai_fdw_settings WHERE component NOT IN ('ssl', 'zlib', 'libSSH', 'nghttp2') ORDER BY component COLLATE "C" DESC; component | has_version ------------+------------- oai_fdw | t libxml | t libcurl | t compiler | t built | t PostgreSQL | t (6 rows) -- Test that oai_fdw_settings view returns core components SELECT COUNT(*) >= 5 AS has_minimum_components, COUNT(*) FILTER (WHERE component = 'oai_fdw') = 1 AS has_oai_fdw, COUNT(*) FILTER (WHERE component = 'PostgreSQL') = 1 AS has_postgresql, COUNT(*) FILTER (WHERE component = 'libxml') = 1 AS has_libxml, COUNT(*) FILTER (WHERE component = 'libcurl') = 1 AS has_libcurl FROM oai_fdw_settings; has_minimum_components | has_oai_fdw | has_postgresql | has_libxml | has_libcurl ------------------------+-------------+----------------+------------+------------- t | t | t | t | t (1 row) -- Server name requiring quotes: exercises quote_identifier() on both the -- SERVER reference and the generated _repository table name. -- No debug output here: PostgreSQL's own DEBUG messages differ between versions. SET client_min_messages TO NOTICE; CREATE SERVER "oai-server ulb" FOREIGN DATA WRAPPER oai_fdw OPTIONS (url 'https://sammlungen.ulb.uni-muenster.de/oai', request_redirect 'true'); CREATE SCHEMA quoting_schema; IMPORT FOREIGN SCHEMA oai_repository FROM SERVER "oai-server ulb" INTO quoting_schema OPTIONS (metadataprefix 'oai_dc'); SELECT foreign_table_name FROM information_schema.foreign_tables WHERE foreign_table_schema = 'quoting_schema'; foreign_table_name --------------------------- oai-server ulb_repository (1 row) DROP SERVER oai_server_dnb CASCADE;