Getting ready

Spreadsheets combine data, presentation, and programs all into one file. That's perfect for power users wanting to work quickly. Like other relational databases, PostgreSQL is mainly concerned with the lowest level of data, so extracting just the data from these spreadsheets can present some challenges.

We can easily handle spreadsheet data if that spreadsheet's layout follows a very specific form, as follows:

  • Each spreadsheet column becomes one column in one table
  • Each row of the spreadsheet becomes one row in one table
  • Data is only in one worksheet of the spreadsheet
  • Optionally, the first row is a list of column descriptions/titles

This is a very simple layout, and more often there will be other things in the spreadsheet, ...

Get PostgreSQL Administration Cookbook, 9.5/9.6 Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.