SET client_min_messages=NOTICE;
CREATE EXTENSION multicorn;
-- Test that the wrapper option is required on the server.
CREATE server multicorn_srv foreign data wrapper multicorn;
ERROR:  The wrapper parameter is mandatory, specify a valid class name
-- Test that the wrapper option cannot be altered on the table
CREATE server multicorn_srv foreign data wrapper multicorn options (
    wrapper 'multicorn.testfdw.TestForeignDataWrapper'
);
CREATE foreign table testmulticorn (
    test1 character varying,
    test2 character varying
) server multicorn_srv options (
    option1 'option1',
    wrapper 'multicorn.evilwrapper.EvilDataWrapper'
);
ERROR:  Cannot set the wrapper class on the table
HINT:  Set it on the server
ALTER server multicorn_srv options (DROP wrapper);
ERROR:  The wrapper parameter is mandatory, specify a valid class name
CREATE server multicorn_empty_srv foreign data wrapper multicorn;
ERROR:  The wrapper parameter is mandatory, specify a valid class name
DROP EXTENSION multicorn cascade;
NOTICE:  drop cascades to server multicorn_srv