commit ece28a9c7503007c8f47e55877c0e79298eea167
Author: Ronan Dunklau <ronan.dunklau@dalibo.com>
Date:   Tue Apr 12 09:08:58 2016 +0200

    Make sure that plpython3 is initialized before Multicorn

diff --git a/test-3.3/expected/write_filesystem.out b/test-3.3/expected/write_filesystem.out
index f45381a..3c69e5f 100644
--- a/test-3.3/expected/write_filesystem.out
+++ b/test-3.3/expected/write_filesystem.out
@@ -1,12 +1,5 @@
 -- Setup the test
 CREATE language plpython3u;
-CREATE EXTENSION multicorn;
-CREATE server multicorn_srv foreign data wrapper multicorn options (
-    wrapper 'multicorn.fsfdw.FilesystemFdw'
-);
-CREATE TABLE temp_dir (dirname varchar);
--- Create a table with the filesystem fdw in a temporary directory,
--- and store the dirname in the temp_dir table.
 CREATE OR REPLACE FUNCTION create_table() RETURNS VOID AS $$
     import plpy
     import tempfile
@@ -38,6 +31,13 @@ CREATE OR REPLACE FUNCTION create_table() RETURNS VOID AS $$
                 with open(os.path.join(dirname, '.'.join([name, ext])), 'a') as fd:
                     fd.write('Im a %s %s %s\n' % (size, color, name))
 $$ language plpython3u;
+CREATE EXTENSION multicorn;
+CREATE server multicorn_srv foreign data wrapper multicorn options (
+    wrapper 'multicorn.fsfdw.FilesystemFdw'
+);
+CREATE TABLE temp_dir (dirname varchar);
+-- Create a table with the filesystem fdw in a temporary directory,
+-- and store the dirname in the temp_dir table.
 select create_table();
  create_table 
 --------------
diff --git a/test-3.3/sql/write_filesystem.sql b/test-3.3/sql/write_filesystem.sql
index e6ea9a4..f9e132b 100644
--- a/test-3.3/sql/write_filesystem.sql
+++ b/test-3.3/sql/write_filesystem.sql
@@ -1,16 +1,6 @@
 -- Setup the test
 CREATE language plpython3u;
 
-CREATE EXTENSION multicorn;
-CREATE server multicorn_srv foreign data wrapper multicorn options (
-    wrapper 'multicorn.fsfdw.FilesystemFdw'
-);
-
-
-CREATE TABLE temp_dir (dirname varchar);
-
--- Create a table with the filesystem fdw in a temporary directory,
--- and store the dirname in the temp_dir table.
 CREATE OR REPLACE FUNCTION create_table() RETURNS VOID AS $$
     import plpy
     import tempfile
@@ -43,6 +33,17 @@ CREATE OR REPLACE FUNCTION create_table() RETURNS VOID AS $$
                     fd.write('Im a %s %s %s\n' % (size, color, name))
 $$ language plpython3u;
 
+CREATE EXTENSION multicorn;
+CREATE server multicorn_srv foreign data wrapper multicorn options (
+    wrapper 'multicorn.fsfdw.FilesystemFdw'
+);
+
+
+CREATE TABLE temp_dir (dirname varchar);
+
+-- Create a table with the filesystem fdw in a temporary directory,
+-- and store the dirname in the temp_dir table.
+
 select create_table();
 
 -- End of Setup
