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

Commitc2a062b

Browse files
committed
Add dbase conversion utility to /contrib.
1 parent72c8af5 commitc2a062b

File tree

8 files changed

+1751
-0
lines changed

8 files changed

+1751
-0
lines changed

‎contrib/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ cube -
3434
Multidimensional-cube datatype (GiST indexing example)
3535
by Gene Selkov, Jr. <selkovjr@mcs.anl.gov>
3636

37+
dbase -
38+
Converts from dbase/xbase to PostgreSQL
39+
by Ivan Baldo, lubaldo@adinet.com.uy
40+
3741
earthdistance -
3842
Operator for computing earth distance for two points
3943
by Hal Snyder <hal@vailsys.com>

‎contrib/dbase/Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# $Header: /cvsroot/pgsql/contrib/dbase/Attic/Makefile,v 1.1 2001/05/10 14:41:23 momjian Exp $
3+
#
4+
5+
subdir = contrib/dbase
6+
top_builddir = ../..
7+
include$(top_builddir)/src/Makefile.global
8+
9+
overrideCPPFLAGS := -I$(libpq_srcdir)$(CPPFLAGS)
10+
11+
OBJS= dbf.o dbf2pg.o endian.o
12+
13+
all: dbf2pg
14+
15+
dbf2pg:$(OBJS)$(libpq_builddir)/libpq.a
16+
$(CC)$(CFLAGS)$(OBJS)$(libpq)$(LDFLAGS)$(LIBS) -liconv -o$@
17+
18+
install: all installdirs
19+
$(INSTALL_PROGRAM) dbf2pg$(X)$(bindir)
20+
$(INSTALL_DATA) README.dbf2pg$(docdir)/contrib
21+
22+
installdirs:
23+
$(mkinstalldirs)$(bindir)$(docdir)/contrib
24+
25+
uninstall:
26+
rm -f$(bindir)/dbf2pg$(X)$(docdir)/contrib/README.dbf2pg
27+
28+
cleandistcleanmaintainer-clean:
29+
rm -f dbf2pg$(X)$(OBJS)
30+
31+
dependdep:
32+
$(CC) -MM -MG$(CFLAGS)*.c> depend
33+
34+
ifeq (depend,$(wildcard depend))
35+
include depend
36+
endif

‎contrib/dbase/README.dbf2pg

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
3+
4+
dbf2sql(1L) dbf2sql(1L)
5+
6+
7+
NAME
8+
dbf2sql- Insert xBase-style.dbf-files into a Post-
9+
greSQL-table
10+
11+
SYNOPSIS
12+
"dbf2pg [options] dbf-file"
13+
Options:
14+
[-v[v]] [-f] [-u | -l] [-c | -D] [-d database] [-t table]
15+
[-h host] [-s oldname=newname[,oldname=newname]] [-s
16+
start] [-e end] [-W] [-U username] [-Btransaction_size]
17+
[-F charset_from [-T charset_to]]
18+
19+
20+
DESCRIPTION
21+
This manual page documents the program dbf2pg. It takes
22+
an xBase-style .dbf-file, and inserts it into the speci-
23+
fied database and table.
24+
25+
OPTIONS
26+
-v Display some status-messages.
27+
28+
-vv Also display progress.
29+
30+
-f Convert all field-names from the .dbf-file to low-
31+
ercase.
32+
33+
-u Convert the contents of all fields to uppercase.
34+
35+
-l Convert the contents of all fields to lowercase.
36+
37+
-c Create the table specified with -t. If this table
38+
already exists, first DROP it.
39+
40+
-D Delete the contents of the table specified with -t.
41+
Note that this table has to exists. Anerror is
42+
returned if this is not the case.
43+
44+
-W Ask for password.
45+
46+
-d database
47+
Specify the database to use. An error is returned
48+
if thisdatabase doesnot exists. Default is
49+
"test".
50+
51+
-t table
52+
Specify the table to insert in. Anerror is
53+
returned if this table does not exists. Default is
54+
"test".
55+
56+
-h host
57+
Specify the host to which to connect. Default is
58+
"localhost".
59+
60+
61+
62+
63+
64+
1
65+
66+
67+
68+
69+
70+
dbf2sql(1L) dbf2sql(1L)
71+
72+
73+
-s oldname=newname[,oldname=newname]
74+
Change the name of a field from oldname to newname.
75+
This ismainlyused to avoid using reserved SQL-
76+
keywords. Example:
77+
-s SELECT=SEL,COMMIT=doit
78+
This is done before the -f operator has taken
79+
effect!
80+
81+
-s start
82+
Specify the first record-number in the xBase-file
83+
we will insert.
84+
85+
-e end Specify the last record-number in the xBase-file we
86+
will insert.
87+
88+
-B transaction_size
89+
Specify the number ofrecords per transaction,
90+
default is all records.
91+
92+
-U username
93+
Log as the specified user in the database.
94+
95+
-F charset_from
96+
If specified, it converts the data from the speci-
97+
fied charset. Example:
98+
-F IBM437
99+
Consult your system documentation to see the con-
100+
vertions available.
101+
102+
-T charset_to
103+
Together with -F charset_from ,it converts the
104+
data to thespecified charset. Default is
105+
"ISO-8859-1".
106+
107+
ENVIRONMENT
108+
This program is affected by theenvironment-variables as
109+
used by "PostgresSQL." See the documentation of Post-
110+
gresSQL for more info.
111+
112+
BUGS
113+
Fields larger than 8192 characters are not supported and
114+
could break the program.
115+
Some charset convertions could cause the output to be
116+
larger than the input and could break the program.
117+
118+
119+
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+
130+
2
131+
132+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp