mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-10 08:17: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.
138 lines
6.4 KiB
HTML
138 lines
6.4 KiB
HTML
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<title>Loading DBF data — pgloader 3.4.1 documentation</title>
|
||
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script type="text/javascript">
|
||
var DOCUMENTATION_OPTIONS = {
|
||
URL_ROOT: '../',
|
||
VERSION: '3.4.1',
|
||
COLLAPSE_INDEX: false,
|
||
FILE_SUFFIX: '.html',
|
||
HAS_SOURCE: true,
|
||
SOURCELINK_SUFFIX: '.txt'
|
||
};
|
||
</script>
|
||
<script type="text/javascript" src="../_static/jquery.js"></script>
|
||
<script type="text/javascript" src="../_static/underscore.js"></script>
|
||
<script type="text/javascript" src="../_static/doctools.js"></script>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="Loading IXF Data" href="ixf.html" />
|
||
<link rel="prev" title="Loading COPY Formatted Files" href="copy.html" />
|
||
|
||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head>
|
||
<body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="loading-dbf-data">
|
||
<h1>Loading DBF data<a class="headerlink" href="#loading-dbf-data" title="Permalink to this headline">¶</a></h1>
|
||
<p>This command instructs pgloader to load data from a <cite>DBF</cite> file. Here’s an
|
||
example:</p>
|
||
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">LOAD</span> <span class="n">DBF</span>
|
||
<span class="n">FROM</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">insee</span><span class="o">.</span><span class="n">fr</span><span class="o">/</span><span class="n">fr</span><span class="o">/</span><span class="n">methodes</span><span class="o">/</span><span class="n">nomenclatures</span><span class="o">/</span><span class="n">cog</span><span class="o">/</span><span class="n">telechargement</span><span class="o">/</span><span class="mi">2013</span><span class="o">/</span><span class="n">dbf</span><span class="o">/</span><span class="n">reg2013</span><span class="o">.</span><span class="n">dbf</span>
|
||
<span class="n">INTO</span> <span class="n">postgresql</span><span class="p">:</span><span class="o">//</span><span class="n">user</span><span class="nd">@localhost</span><span class="o">/</span><span class="n">dbname</span>
|
||
<span class="n">WITH</span> <span class="n">truncate</span><span class="p">,</span> <span class="n">create</span> <span class="n">table</span><span class="p">;</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The <cite>dbf</cite> format command accepts the following clauses and options.</p>
|
||
<div class="section" id="dbf-source-specification-from">
|
||
<h2>DBF Source Specification: FROM<a class="headerlink" href="#dbf-source-specification-from" title="Permalink to this headline">¶</a></h2>
|
||
<p>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.</p>
|
||
</div>
|
||
<div class="section" id="dbf-loading-options-with">
|
||
<h2>DBF Loading Options: WITH<a class="headerlink" href="#dbf-loading-options-with" title="Permalink to this headline">¶</a></h2>
|
||
<p>When loading from a <cite>DBF</cite> file, the following options are supported:</p>
|
||
<blockquote>
|
||
<div><ul>
|
||
<li><p class="first"><em>truncate</em></p>
|
||
<p>When this option is listed, pgloader issues a <cite>TRUNCATE</cite> command against
|
||
the PostgreSQL target table before reading the data file.</p>
|
||
</li>
|
||
<li><p class="first"><em>disable triggers</em></p>
|
||
<p>When this option is listed, pgloader issues an <cite>ALTER TABLE … DISABLE
|
||
TRIGGER ALL</cite> command against the PostgreSQL target table before copying
|
||
the data, then the command <cite>ALTER TABLE … ENABLE TRIGGER ALL</cite> once the
|
||
<cite>COPY</cite> is done.</p>
|
||
<p>This option allows loading data into a pre-existing table ignoring the
|
||
<em>foreign key constraints</em> and user defined triggers and may result in
|
||
invalid <em>foreign key constraints</em> once the data is loaded. Use with
|
||
care.</p>
|
||
</li>
|
||
<li><p class="first"><em>create table</em></p>
|
||
<p>When this option is listed, pgloader creates the table using the meta
|
||
data found in the <cite>DBF</cite> file, which must contain a list of fields with
|
||
their data type. A standard data type conversion from DBF to PostgreSQL
|
||
is done.</p>
|
||
</li>
|
||
<li><p class="first"><em>table name</em></p>
|
||
<p>This options expects as its value the possibly qualified name of the
|
||
table to create.</p>
|
||
</li>
|
||
</ul>
|
||
</div></blockquote>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper"><div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="../index.html">Documentation overview</a><ul>
|
||
<li>Previous: <a href="copy.html" title="previous chapter">Loading COPY Formatted Files</a></li>
|
||
<li>Next: <a href="ixf.html" title="next chapter">Loading IXF Data</a></li>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3>Quick search</h3>
|
||
<form class="search" action="../search.html" method="get">
|
||
<div><input type="text" name="q" /></div>
|
||
<div><input type="submit" value="Go" /></div>
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2017, Dimitri Fontaine.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.5</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
||
|
||
|
|
||
<a href="../_sources/ref/dbf.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |