Skip site navigation (1) Skip section navigation (2)

Import: function report

From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org(dot)
Subject: Import: function report
Date: 2009-01-21 10:54:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers
Hi all

This mail will describe "import function" with some pictures.

1. Entry (table context menu):

2. Source type:
These items will be certer of wizard, don't worry about this now.
The third option "Database". It is unnecessary and will be removed.
Beacause the end users can do it with db-link.
The ODBC option will be enabled only when wxWidgets is compiled with wxUSE_ODBC=1.
Maybe some users need more kinds of source. This is the reason why separate
them from others options.
Yesterday, I thought import from archieve file (tar gz zip ...) may needed.
The users often get a compressed file when there are large data.

3. Text file:
There are about 39 encoding.
Delimiter can be multi-wchars.
Width delimiter separeted by comma, like "10,15,,23" (empty means 0).
Quote by single or double quotation.

4. Option:
The option "Set NULL on empty text" will be extends to other types.
Just like:
    On empty text:
        Boolean : false
        Numberic: 0
        Char    : NULL
        and so forth
New options will be added:
    Boolean true : (yes,y,1,on)
    Boolean false: (no, n,0,off)
and more.

5 Format:
The "Ignore formats" Option will try to insert data into DB without any change.
New option "format style" will be added, user can select a style, ANSI C, PostgreSQL, RFC-822.
If users would like to use COPY to insert into DB, them have to select a non-pgsql style.

6. Column
The target table's column info.
The users can select source column for every table column and set its format.
In my plan, there is a new col "option", user can control act when empty value incurred.
(That be set in Option page will be default here.)
If the user decide to insert data with INSERT, then "Expression" col can be used to set
a single PostgreSQL expression, like "Column #1 || Columns #12".

Grid in bottom is a preview.

7. Status
Destination can be "create INSERT statments into file", "create COPY statments into file",
    "Import into database with INSERT", "Import into database with COPY", and so on.
And more log option. (Save to log file, Only log error/warn.)

This is my plan about import from text file.
Most of code is not completed.
You are welcome to give me any suggestions.

It looks too complicated. Can I implement it? ( o.O )


Quan Zongliang
CIT Japan:
CIT China:


pgadmin-hackers by date

Next:From: Magnus HaganderDate: 2009-01-21 12:39:38
Subject: Re: Patch for pgScript
Previous:From: Dave PageDate: 2009-01-21 09:59:33
Subject: Re: Server Status window work

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group