CSV import / export

Поиск
Список
Период
Сортировка
От Robins Tharakan
Тема CSV import / export
Дата
Msg-id 36af4bed0811261800w5e24796bmf01427978eea8cb9@mail.gmail.com
обсуждение исходный текст
Ответы Re: CSV import / export  (Quan Zongliang <quanzongliang@gmail.com>)
Re: CSV import / export  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-hackers
Hi,

While looking at the PgAdmin ToDo list, I saw CSV import as one of the things to do. I just wanted to ask a few things before starting work on it, so as to ensure that it's envisioned in the way I plan to work on it.

  • Apart from CSV import, are we planning to add an 'export' to CSV via the Backup dialog box ? (We could add a 'CSV radio button' under 'Format' and change the radio buttons below to things like 'Include headers, column separators, etc...). But importantly, since its not mentioned in the ToDo, is an export to CSV (of a single table) even on the cards ? Frankly I ask this also because currently the only way to export a table in CSV is to do a 'SELECT * FROM table' in SQL query box and save to file, which is quite lengthy a process.
  • I read a bit about wxWidgets and didn't see any relevant libraries there. Are there any 'obvious' libraries (in wxWidgets or otherwise) that I should use to parse csv into an array ? For e.g. PHP has a pretty neat function like fgetcsv ... that converts a csv file to an array of arrays. Anything similar to that, or should I have to make that myself ?
  • I have outlined a few details of Import to CSV, please feel free to change (or completely rewrite :) the way it should work. I'll try and attempt this if no one else is working on it right now.

Import to CSV:
  1. 'Restore' option when one right-clicks on a table name, should allow for importing via CSV. A radio button above the file selection defaults to a 'Backup' file, but has an extra added option of a 'CSV file' along with it.
  2. (While importing from a CSV file) A set of preferences that could allow a user to alter CSV import preferences. For e.g. column-separator, line-separators, 'include headers' etc.. (Personally I'd prefer defaults to these to be modifyable, but File-Options-Preferences is too generic for these settings. Any better place for such options ?)
  3. During import, if an error occurs, A dialogue box is thrown that provides for three options. Either mute successive errors if any, keep showing them, or altogether stop the import.
That's all that I could muster with.
Any feedback on the above would be appreciated.

Thanks
Robins Tharakan

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Jean-Michel Pouré
Дата:
Сообщение: Re: Are there plans to display memory usage: pg_buffercache
Следующее
От: Quan Zongliang
Дата:
Сообщение: Re: CSV import / export