The typical answer is this:
-
In Excel, File/Save As, select CSV, save your current sheet.
-
transfer to a holding directory on the Pg server the postgres user can access
-
in PostgreSQL:
COPY mytable FROM '/path/to/csv/file' WITH CSV HEADER; -- must be superuser
But there are other ways to do this too. PostgreSQL is an amazingly programmable database. These include:
-
Write a module in pl/javaU, pl/perlU, or other untrusted language to access file, parse it, and manage the structure.
-
Use CSV and the fdw_file to access it as a pseudo-table
-
Use DBILink and DBD::Excel
-
Write your own foreign data wrapper for reading Excel files.
The possibilities are literally endless….