Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c5d0ae

Browse files
committed
Add contrib/file_fdw foreign-data wrapper for reading files via COPY.
This is both very useful in its own right, and an important test casefor the core FDW support.This commit includes a small refactoring of copy.c to expose its optionchecking code as a separately callable function. The original patchsubmission duplicated hundreds of lines of that code, which seemed prettyunmaintainable.Shigeru Hanada, reviewed by Itagaki Takahiro and Tom Lane
1 parentbb74240 commit7c5d0ae

File tree

19 files changed

+1171
-55
lines changed

19 files changed

+1171
-55
lines changed

‎contrib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SUBDIRS = \
1818
dict_xsyn\
1919
dummy_seclabel\
2020
earthdistance\
21+
file_fdw\
2122
fuzzystrmatch\
2223
hstore\
2324
intagg\

‎contrib/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ earthdistance -
7373
Functions for computing distances between two points on Earth
7474
by Bruno Wolff III <bruno@wolff.to> and Hal Snyder <hal@vailsys.com>
7575

76+
file_fdw
77+
Foreign-data wrapper for server-side CSV/TEXT files
78+
by Shigeru Hanada <hanada@metrosystems.co.jp>
79+
7680
fuzzystrmatch -
7781
Levenshtein, metaphone, and soundex fuzzy string matching
7882
by Joe Conway <mail@joeconway.com> and Joel Burton <jburton@scw.org>

‎contrib/file_fdw/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated subdirectories
2+
/results/

‎contrib/file_fdw/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# contrib/file_fdw/Makefile
2+
3+
MODULES = file_fdw
4+
5+
EXTENSION = file_fdw
6+
DATA = file_fdw--1.0.sql
7+
8+
REGRESS = file_fdw
9+
10+
EXTRA_CLEAN = sql/file_fdw.sql expected/file_fdw.out
11+
12+
ifdefUSE_PGXS
13+
PG_CONFIG = pg_config
14+
PGXS :=$(shell$(PG_CONFIG) --pgxs)
15+
include$(PGXS)
16+
else
17+
subdir = contrib/file_fdw
18+
top_builddir = ../..
19+
include$(top_builddir)/src/Makefile.global
20+
include$(top_srcdir)/contrib/contrib-global.mk
21+
endif

‎contrib/file_fdw/data/agg.bad

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
56;@7.8@
2+
100;@99.097@
3+
0;@aaa@
4+
42;@324.78@

‎contrib/file_fdw/data/agg.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
56;@7.8@
2+
100;@99.097@
3+
0;@0.09561@
4+
42;@324.78@

‎contrib/file_fdw/data/agg.data

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
567.8
2+
10099.097
3+
00.09561
4+
42324.78

‎contrib/file_fdw/expected/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/file_fdw.out

‎contrib/file_fdw/file_fdw--1.0.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* contrib/file_fdw/file_fdw--1.0.sql*/
2+
3+
CREATEFUNCTIONfile_fdw_handler()
4+
RETURNS fdw_handler
5+
AS'MODULE_PATHNAME'
6+
LANGUAGE C STRICT;
7+
8+
CREATEFUNCTIONfile_fdw_validator(text[],oid)
9+
RETURNS void
10+
AS'MODULE_PATHNAME'
11+
LANGUAGE C STRICT;
12+
13+
CREATE FOREIGN DATA WRAPPER file_fdw
14+
HANDLER file_fdw_handler
15+
VALIDATOR file_fdw_validator;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp