1

I need to be able to import an Excel spreadsheet into a PostgreSQL database. The goal is for use with a Rails application. I have looked at the Roo gem and it takes 16 seconds to convert a 2000 line XLS file to CSV which is unacceptable. So I was wondering if I could just short-circuit the Rails application and import directly into PostgreSQL.

Is there a way to import data from an Excel spreadsheet directly into PostgreSQL?

1 Answer 1

7

No, PostgreSQL does not read the XLS file format (nor the XLSX format). You can import from CSV, and in some cases from XML, but that's all (without external preprocessing).

However, if you actually have access to Excel, you can always just export it in an open format (preferrably CSV) directly from inside Excel.

Sign up to request clarification or add additional context in comments.

2 Comments

That's unfortunate, I was hoping to find something similar to SQL Server's DTS functionality.
No need to have such functionality built into the server. It's not built into SQL Server either - it's just bundled in "the box". I believe many generic tools will do it - most will talk to anything that has JDBC on the database side, for example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.