mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			119 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
			
		
		
	
	
			119 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
| .\" $PostgreSQL: pgsql/contrib/dbase/dbf2pg.1,v 1.3 2006/03/11 04:38:28 momjian Exp $
 | |
| 
 | |
| .TH dbf2sql 1L \" -*- nroff -*-
 | |
| .SH NAME
 | |
| dbf2sql \- Insert xBase\-style .dbf\-files into a PostgreSQL\-table
 | |
| .SH SYNOPSIS
 | |
| .B dbf2pg [options] dbf-file
 | |
| .br
 | |
| .br
 | |
| Options:
 | |
| .br
 | |
| [-v[v]] [-f] [-u | -l] [-c | -D] [-d database] [-t table]
 | |
| [-h host] [-s oldname=[newname][,oldname=[newname]]]
 | |
| [-b start] [-e end] [-W] [-U username] [-B transaction_size]
 | |
| [-F charset_from [-T charset_to]]
 | |
| 
 | |
| .SH DESCRIPTION
 | |
| This manual page documents the program
 | |
| .BR dbf2pg.
 | |
| It takes an xBase-style .dbf-file, and inserts it into the specified
 | |
| database and table.
 | |
| .SS OPTIONS
 | |
| .TP
 | |
| .I "\-v"
 | |
| Display some status-messages.
 | |
| .TP
 | |
| .I "-vv"
 | |
| Also display progress.
 | |
| .TP
 | |
| .I "-f"
 | |
| Convert all field-names from the .dbf-file to lowercase.
 | |
| .TP
 | |
| .I "-u"
 | |
| Convert the contents of all fields to uppercase.
 | |
| .TP
 | |
| .I "-l"
 | |
| Convert the contents of all fields to lowercase.
 | |
| .TP
 | |
| .I "-c"
 | |
| Create the table specified with
 | |
| .IR \-t .
 | |
| If this table already exists, first
 | |
| .BR DROP
 | |
| it.
 | |
| .TP
 | |
| .I "-D"
 | |
| Delete the contents of the table specified with
 | |
| .IR \-t .
 | |
| Note that this table has to exists. An error is returned if this is not the
 | |
| case.
 | |
| .TP
 | |
| .I "-W"
 | |
| Ask for password.
 | |
| .TP
 | |
| .I "-d database"
 | |
| Specify the database to use. An error is returned if this database does not
 | |
| exists. Default is "test".
 | |
| .TP
 | |
| .I "-t table"
 | |
| Specify the table to insert in. An error is returned if this table does not
 | |
| exists. Default is "test".
 | |
| .TP
 | |
| .I "-h host"
 | |
| Specify the host to which to connect. Default is "localhost".
 | |
| .TP
 | |
| .I "-s oldname=newname[,oldname=newname]"
 | |
| Change the name of a field from
 | |
| .BR oldname
 | |
| to
 | |
| .BR newname .
 | |
| This is mainly used to avoid using reserved SQL-keywords. Example:
 | |
| .br
 | |
| .br
 | |
| -s SELECT=SEL,COMMIT=doit
 | |
| .br
 | |
| .br
 | |
| This is done
 | |
| .BR before
 | |
| the
 | |
| .IR -f
 | |
| operator has taken effect!
 | |
| .TP
 | |
| .I "-b start"
 | |
| Specify the first record-number in the xBase-file we will insert.
 | |
| .TP
 | |
| .I "-e end"
 | |
| Specify the last record-number in the xBase-file we will insert.
 | |
| .TP
 | |
| .I "-B transaction_size"
 | |
| Specify the number of records per transaction, default is all records.
 | |
| .TP
 | |
| .I "-U username"
 | |
| Log as the specified user in the database.
 | |
| .TP
 | |
| .I "-F charset_from"
 | |
| If specified, it converts the data from the specified charset. Example:
 | |
| .br
 | |
| .br
 | |
| -F IBM437
 | |
| .br
 | |
| .br
 | |
| Consult your system documentation to see the convertions available.
 | |
| .TP
 | |
| .I "-T charset_to"
 | |
| Together with
 | |
| .I "-F charset_from"
 | |
| , it converts the data to the specified charset. Default is "ISO-8859-1".
 | |
| .SH ENVIRONMENT
 | |
| This program is affected by the environment-variables as used
 | |
| by
 | |
| .B PostgresSQL.
 | |
| See the documentation of PostgresSQL for more info.
 | |
| .SH BUGS
 | |
| Fields larger than 8192 characters are not supported and could break the
 | |
| program.
 | |
| .br
 | |
| Some charset convertions could cause the output to be larger than the input
 | |
| and could break the program.
 |