summaryrefslogtreecommitdiff
path: root/contrib/dbase/README.dbf2pg
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-07-31 02:12:43 +0000
committerBruce Momjian <bruce@momjian.us>2003-07-31 02:12:43 +0000
commit82bade79dce6ff239cba1491c5843ea8ba2bfcc8 (patch)
tree7781f7715a4b3dc50c6ae36c26a5b39b27c26762 /contrib/dbase/README.dbf2pg
parent52347b66370988e55b5b55d78d54ec8f13d1123b (diff)
downloadpostgresql-82bade79dce6ff239cba1491c5843ea8ba2bfcc8.tar.gz
dbf2pg - Insert xBase-style .dbf-files into a PostgreSQL-table
There is an option "-s oldname=newname", which changes the old field name of the dbf-file to the newname in PostgeSQL. If the length of the new name is 0, the field is skiped. If you want to skip the first field of the dbf-file, you get the wildest error-messages from the backend. dbf2pg load the dbf-file via "COPY tablename FROM STDIN". If you skip the first field, it is an \t to much in STDIN. A fix could be an counter j=0, which increments only, if a field is imported (IF (strlen(fields[h].db_name)> 0) j++. And only if j > 1 (if an other field is imported) the \t is printed. An other small bug in the README: -s start Specify the first record-number in the xBase-file we will insert. should be -e start Specify the first record-number in the xBase-file we will insert. Thomas Behr
Diffstat (limited to 'contrib/dbase/README.dbf2pg')
-rw-r--r--contrib/dbase/README.dbf2pg14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/dbase/README.dbf2pg b/contrib/dbase/README.dbf2pg
index 7203be4029..7154819655 100644
--- a/contrib/dbase/README.dbf2pg
+++ b/contrib/dbase/README.dbf2pg
@@ -12,7 +12,7 @@ SYNOPSIS
"dbf2pg [options] dbf-file"
Options:
[-v[v]] [-f] [-u | -l] [-c | -D] [-d database] [-t table]
- [-h host] [-s oldname=newname[,oldname=newname]] [-s
+ [-h host] [-s oldname=[newname][,oldname=[newname]]] [-b
start] [-e end] [-W] [-U username] [-B transaction_size]
[-F charset_from [-T charset_to]]
@@ -70,15 +70,19 @@ DESCRIPTION
dbf2sql(1L) dbf2sql(1L)
- -s oldname=newname[,oldname=newname]
+ -s oldname=[newname][,oldname=[newname]]
Change the name of a field from oldname to newname.
This is mainly used to avoid using reserved SQL-
- keywords. Example:
- -s SELECT=SEL,COMMIT=doit
+ keywords. When the new fieldname is empty, the field
+ is skipped in both the CREATE-clause and the
+ INSERT-clauses, in common words: it will not be present
+ in the SQL-table.
+ Example:
+ -s SELECT=SEL,remark=,COMMIT=doit
This is done before the -f operator has taken
effect!
- -s start
+ -b start
Specify the first record-number in the xBase-file
we will insert.