mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-08 15:27:00 +02:00
The website is moving to pgloader.org and readthedocs.io is going to be integrated. Let's see what happens. The docs build fine locally with the sphinx tools and the docs/Makefile. Having separate files for the documentation should help ease the maintenance and add new topics, such as support for Common Lisp Hackers level docs, which are currently missing.
54 lines
1.8 KiB
ReStructuredText
54 lines
1.8 KiB
ReStructuredText
Loading DBF data
|
|
=================
|
|
|
|
This command instructs pgloader to load data from a `DBF` file. Here's an
|
|
example::
|
|
|
|
LOAD DBF
|
|
FROM http://www.insee.fr/fr/methodes/nomenclatures/cog/telechargement/2013/dbf/reg2013.dbf
|
|
INTO postgresql://user@localhost/dbname
|
|
WITH truncate, create table;
|
|
|
|
The `dbf` format command accepts the following clauses and options.
|
|
|
|
DBF Source Specification: FROM
|
|
------------------------------
|
|
|
|
Filename where to load the data from. This support local files, HTTP URLs
|
|
and zip files containing a single dbf file of the same name. Fetch such a
|
|
zip file from an HTTP address is of course supported.
|
|
|
|
DBF Loading Options: WITH
|
|
-------------------------
|
|
|
|
When loading from a `DBF` file, the following options are supported:
|
|
|
|
- *truncate*
|
|
|
|
When this option is listed, pgloader issues a `TRUNCATE` command against
|
|
the PostgreSQL target table before reading the data file.
|
|
|
|
- *disable triggers*
|
|
|
|
When this option is listed, pgloader issues an `ALTER TABLE ... DISABLE
|
|
TRIGGER ALL` command against the PostgreSQL target table before copying
|
|
the data, then the command `ALTER TABLE ... ENABLE TRIGGER ALL` once the
|
|
`COPY` is done.
|
|
|
|
This option allows loading data into a pre-existing table ignoring the
|
|
*foreign key constraints* and user defined triggers and may result in
|
|
invalid *foreign key constraints* once the data is loaded. Use with
|
|
care.
|
|
|
|
- *create table*
|
|
|
|
When this option is listed, pgloader creates the table using the meta
|
|
data found in the `DBF` file, which must contain a list of fields with
|
|
their data type. A standard data type conversion from DBF to PostgreSQL
|
|
is done.
|
|
|
|
- *table name*
|
|
|
|
This options expects as its value the possibly qualified name of the
|
|
table to create.
|