Import: I need help

Поиск
Список
Период
Сортировка
От Quan Zongliang
Тема Import: I need help
Дата
Msg-id 20090213111232.33F1.4125B4E5@gmail.com
обсуждение исходный текст
Ответы Re: Import: I need help  (Dave Page <dpage@pgadmin.org>)
Re: Import: I need help  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-hackers
Hi, all

I haven't any experience with libpq. So there are a lot of questions.

When import to db using INSERT statement. Like this:
   res = PQexec(m_conn->connection(), "BEGIN");
   LOOP: res = PQexec(m_conn->connection(), "INSERT INTO ...");
   res = PQexec(m_conn->connection(), "COMMIT");
If any INSERT statement failed in the middle, the whole transaction is aborted.
In my plan, the end user can select a number of rows to commit their work.
(Option: commit every xxx rows.)
Is there a approach to ingnore error statement and leave current transaction
in normal status? If it can be did, the program only need log the error and
go on to deal with left statements.
Or when encounter a error, stop the deal?

If the end user decide to import with INSERT statement,
these statements will be sent to db with asynchronous mode:
LOOP:
   1: submit statement asynchronous
   2: generate next statement
   3: wait for last one to be completed
   4: log
   goto 1
Is it OK?
Or we should use synchronous mode?

First, import function with INSERT statement will be implemented.
The questions about COPY command will come soon. ^-^

A discussion:
In schemas, the pgDatatype had been defined. but it use type-name to recognise type.
I noticed system types had been defined in server/catalog/pg_type.h:
#define BOOLOID            16
#define BYTEAOID        17
and so on.
Why don't use these defination in the pgAdmin?
The judgement with (type==BOOLOID) will get more effective than (name == wxT("boolean")).

Thanks.

-----------------------------------------------
Quan Zongliang
quanzongliang@gmail.com
CIT Japan:  http://www.cit.co.jp
CIT China:  http://www.citbj.com.cn


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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Server Status window work
Следующее
От: Dave Page
Дата:
Сообщение: Re: Import: I need help