With Windows systems, Excel is always unavoidable.
The Postgres version is 9.3.6;windows 8.1 64-bit.
There is no way to find Excel directly import Postgres, there is a tool is XLSTOPG, similar to SQL Server Import and Export Data Wizard, but not open source; You can search the Internet to play (as if the trial version can only guide 1000 records), I am not well-known site up and down an attempt is cracked version, the result of computer poisoning, spent two night time, the computer was fortunately no reload system. I can only say that some sites are not things, you say you have a lot of plug-ins (the game's client, calendar and other messy things), I endure, but also pop up so many ads (games, Pornography) Web page, I TMD also endure, who let me want to save the cheap hand to download it? The Green Egg. Or the first time I downloaded on other sites like XLSTOPG can only guide 1000 records, which I also tmd to endure; the key is nnnd, I unload the mess, the internet for about 20 minutes, the lower right corner of the desktop out of the ads, jump, the CPU quickly 100% And very stable has been 100%. Well, complaining about it, I'm going to write down the process of dealing with this event.
Here's how to work with Excel: Postgres has a copy command to import the CSV format into the database. Save Excel as CSV format and import postgres; First, make the table, and then use the following command
Command: Copy test from ' D:/a.csv ' delimiter as ', ' csv quote as ' "'
Test is a table name
' D:/a.csv ' means the path, the path contains Chinese not, probably because my postgres encoding format is UTF8, anyway, I use Chinese not, instead of English is good.
If the results of the query are to be exported to Excel, I will also pilot the TXT format and then convert to Excel.
CSV format, using SQL query window file--Export
Then build Excel open txt, also need to choose character encoding, etc., copy may be garbled, and finally save as Excel format is OK.
Import and export of Excel in the Postgres database