Thread: pgadmin csv problems
Hello everybody! I recently ran into a (hopefully small) problem. When I dump a database to a CSV file with pgadmin II (Could not find the option to do it in pgAdmin III, which is a pity, I really like the feature) and then TRUNCATE the table (so there should be no more data in it) and then try to load fresh csv-data in the table (or the just dumped table) I get the following error: With full debug on: An error has occurred in Import Wizard:Import Wizard:frmWizard.cmdOK_click: Number 0. Description <empty> With debugging on Error and SQL Queries: Number: 9 Description: Subscript out of range. Any ideas how to solve this? I want the CSV-file imported. I use pgAdmin II 1.6.0 (pgAdmin III is 1.0.1) Database is: 7.3.2 (am working on migration to 7.3.4) I know this used to work some time in the past... but don't know how the situation was exactly... (which versions I used, that is) I have full rights to the database. (The mail can be delayed, because my published email address has changed (corporate decision). oh well... Thanks in advance tho! Michiel Lange ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail.
Michiel Lange wrote: >Hello everybody! > >I recently ran into a (hopefully small) problem. When I dump a database to >a CSV file with pgadmin II (Could not find the option to do it in pgAdmin >III, which is a pity, I really like the feature) > Can't help with pgAdmin2, but in pgAdmin3 you can run a query in the query tool and export the result, or run the query directly to a file (CSV with some options). Regards, Andreas
Thanks for the quick response... I think I found the real problem. I should've added a semicolon (my field-delimiter) after each line... that kind of worked... However now I get into a trickier problem: there's a field I named 'level', so to see there's a small problem with that... because there are quotes placed around it automatically... It results in this query (from the logfile): conn=47841352, query='INSERT INTO public.items ("itemname", "wearlocation", ""level"", "str", ""int"", "wis", "dex", "con", "ac", "age", "arm", "av", "dam", "hit", "hp", "hr", "lb", "man", "mov", "sex", ""Area"", "save_vs_spell", "alignment") VALUES ('An oaken staff ', 'Wield', '"10"', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Moonshae Islands', '0', '0')' ERROR from backend during send_query: 'ERROR: parser: zero-length delimited identifier at or near """" at character 55' And so there's also the field 'int', which will give the same problem. I will try to rename the fields, and if that's not possible rebuild the schema... Michiel out... thanks for the help though! I'll see if it is possible to import data with the query tool... and thus import csv files... ================================================ De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================ The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. Andreas Pflug <pgadmin@pse-consulting.de> 01-12-2003 13:36 To: Michiel Lange <Michiel_Lange@actuera.com> cc: pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] pgadmin csv problems Michiel Lange wrote: >Hello everybody! > >I recently ran into a (hopefully small) problem. When I dump a database to >a CSV file with pgadmin II (Could not find the option to do it in pgAdmin >III, which is a pity, I really like the feature) > Can't help with pgAdmin2, but in pgAdmin3 you can run a query in the query tool and export the result, or run the query directly to a file (CSV with some options). Regards, Andreas
Michiel Lange wrote: >However now I get into a trickier problem: >there's a field I named 'level', so to see there's a small problem with >that... because there are quotes placed around it automatically... It > > rename will probably do the job. >Michiel out... >thanks for the help though! I'll see if it is possible to import data with >the query tool... and thus import csv files... > > pgAdmin3 doesn't have import, we'll add this (or a sophisticated import/transform tool) later. Regards, Andreas