Revert "Refactor requirement check of file_fdw."
authorShigeru Hanada <[email protected]>
Fri, 1 Jul 2011 06:45:25 +0000 (15:45 +0900)
committerShigeru Hanada <[email protected]>
Fri, 1 Jul 2011 06:45:25 +0000 (15:45 +0900)
This reverts commit 061e6f039beebc1d9527b35e210ffaf8bce874ed.

contrib/file_fdw/file_fdw.c

index 74cff496562445e588b0a400b5353dca2a34a597..466c015107db28b46601b759ad4542d6589a597c 100644 (file)
@@ -286,6 +286,10 @@ fileGetOptions(Oid foreigntableid,
        }
        prev = lc;
    }
+   if (*filename == NULL)
+       ereport(ERROR,
+               (errcode(ERRCODE_FDW_UNABLE_TO_CREATE_REPLY),
+                errmsg("filename is required for file_fdw foreign tables")));
    *other_options = options;
 }
 
@@ -304,10 +308,6 @@ filePlanForeignScan(Oid foreigntableid,
 
    /* Fetch options --- we only need filename at this point */
    fileGetOptions(foreigntableid, &filename, &options);
-   if (filename == NULL)
-       ereport(ERROR,
-               (errcode(ERRCODE_FDW_UNABLE_TO_CREATE_REPLY),
-                errmsg("filename is required for file_fdw foreign tables")));
 
    /* Construct FdwPlan with cost estimates */
    fdwplan = makeNode(FdwPlan);