From 397fd464b63a47689004a88e6c83e024521b789a Mon Sep 17 00:00:00 2001 From: pasman Date: Mon, 10 Oct 2011 08:21:58 +0200 Subject: [PATCH] Extend file_fdw wrapper. Allows to add options to foreign server: encoding, format, header, delimiter, escape, quote, null. --- contrib/file_fdw/file_fdw.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 4eb87e6..acb043e 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -17,6 +17,7 @@ #include "access/reloptions.h" #include "catalog/pg_foreign_table.h" +#include "catalog/pg_foreign_server.h" #include "commands/copy.h" #include "commands/defrem.h" #include "commands/explain.h" @@ -44,6 +45,16 @@ struct FileFdwOption * fileGetOptions(), which currently doesn't bother to look at user mappings. */ static struct FileFdwOption valid_options[] = { + + /*Server options*/ + {"format", ForeignServerRelationId}, + {"header", ForeignServerRelationId}, + {"delimiter", ForeignServerRelationId}, + {"quote", ForeignServerRelationId}, + {"escape", ForeignServerRelationId}, + {"null", ForeignServerRelationId}, + {"encoding", ForeignServerRelationId}, + /* File options */ {"filename", ForeignTableRelationId}, -- 1.7.6.msysgit.0