Select Page

SIRENE is the database on French companies that is produced by the French office of statistics: INSEE. This database has been opened in January 2017 and wasn’t for free until there. There are more than 10 millions of entries in it.

I found a few resources on the web, and this complete post about an import in MySQL, but nothing really about PostgreSQL. You can find it in French on the Marmelab blog.

Here you’ll find the steps I followed to import this database in PostgreSQL:

First download the last SIRENE “stock” file from the French governmental open data website:

To unzip the file, I wouldn’t recommend a double-click on the file because it produces an .cpgz archive. Rather unzip this file from your terminal with this command line:

Then create a SIRENE database, and a table “entreprises”, and create the columns as followed with this SQL query:

Import your unzipped SIRENE .csv file in the table entreprises

Preferences for the file import
name: entreprises
format: csv
encoding: LATIN 1

diverse options:
check: header
delimiter: ;

options on quotes:
select for quotes: “”