How do I import data from a excel sheet onto a PGSQL database on linux?
The easy way is to export the data from Excel, to a CSV by using the SAVE AS
functionality. Then use psql's native \COPY
feature. You can find more information about it by using the command \? COPY
in psql, or by visiting the docs on COPY.
Another option (a bit of a workaround, but should work) is to import the Excel file into Access and then upping the resulting table into PostgreSQL over an ODBC connection.
If you do this on a regular basis, then you should look into Aqua Data Studio - I've found it pretty useful.
I do this all the time and use Navicat[1] (about $79). You'll need a windows box to run the client as the linux client can't import from Excel.
You can import almost any data format (Access, Excel, DBF, Lotus ...), define a mapping between the source and destination which can be saved.
BTW I don't work for Navicat! Just I've tried a few DBA clients and this was by far the best for data imports.
[1] http://www.navicat.com/en/products/navicat_pgsql/pgsql_overview.html