O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading data from flat files

Loading data into your database is one of the most important tasks. You need to do this accurately and quickly. Here's how.

Getting ready

You'll need a copy of pgloader that is available at the following website:

http://pgloader.projects.postgresql.org/

How to do it...

PostgreSQL includes a command named COPY that provides the basic data load/unload mechanism. COPY doesn't do enough when loading data, so let's skip the basic command and go straight to pgloader.

To load data we need to understand our requirements, so let's break this down into a step-by-step process, as follows:

  • Identify data files and where they are located. Make sure pgloader is installed at the location of the files.
  • Identify the table into which we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required