Import: empty string and expression

Поиск
Список
Период
Сортировка
От Quan Zongliang
Тема Import: empty string and expression
Дата
Msg-id 20090224174304.5BD4.4125B4E5@gmail.com
обсуждение исходный текст
Ответы Re: Import: empty string and expression  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Hi, all

String:
How to distinguish NULL and empty?

In the COPY command, it conside no quoted empty as NULL and quoted ones as empty.
This rule not defined in the CSV standard(RFC4180).
For example:
   A,,B  has three item: 'A', NULL and 'B'
   A,"",B has three item: 'A', empty and 'B'
Should we follow this rule?
I think it is good.

Some code must be rewrited, because I treat both as empty now.
And with wxString, null and empty can't be distiguished.

Expression:
If end users decide to import with INSERT statement, they can define expressions.
(With other cases, only the constants can be used.
The pgLoader support this option. I forgot to support constants.
Thanks Guillaume, he introduced this good tool to me.)
Those ones must has one column and one row.
That is, it must can be valuated by SELECT statement emitted FROM clauses.

Now, I use <column-name> style in the expression.
The delimiter option use this style too. (<TAB> means TAB char.)
Exscaped char is XML-style, & < and > , and so on.
Because I noticed pgAdmin has a option "Show NULL values as <NULL>".
Is it appropriate?

Regards.

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


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

Предыдущее
От: Ashesh Vashi
Дата:
Сообщение: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog
Следующее
От: Dave Page
Дата:
Сообщение: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog