On 03/02/2018 06:46 AM, Stéphane Klein wrote:


Sorry, it is not kea but db2 in my example. I did a mistake when I replace the db name in my example.

You need to read:

   CREATE EXTENSION IF NOT EXISTS postgres_fdw;
   DROP SERVER IF EXISTS db2 CASCADE;
  CREATE SERVER db2 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'db2', dbname 'db2');   CREATE USER MAPPING FOR USER SERVER db2 OPTIONS (user 'db2', password 'password');

   CREATE SCHEMA IF NOT EXISTS db2;

   IMPORT FOREIGN SCHEMA public FROM SERVER db2 INTO db2;

I don't know much about pgTap, but my first instinct would be to change:

BEGIN;
  SELECT plan(1);

  \i /test/init.sql

  SELECT ok(
    (SELECT COUNT(host_id) FROM db2.hosts) = 1,
    'foobar'
  );

to:


BEGIN;

  \i /test/init.sql

  SELECT plan(1);

  SELECT ok(
    (SELECT COUNT(host_id) FROM db2.hosts) = 1,
    'foobar'
  );


--
Adrian Klaver
adrian.kla...@aklaver.com

Reply via email to