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

Import: empty string and expression

From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org(dot)
Subject: Import: empty string and expression
Date: 2009-02-24 09:23:26
Message-ID: 20090224174304.5BD4.4125B4E5@gmail.com (view raw or flat)
Thread:
Lists: 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, &amp; &lt; and &gt; , and so on.
Because I noticed pgAdmin has a option "Show NULL values as <NULL>".
Is it appropriate?

Regards.

-----------------------------------------------
Quan Zongliang
quanzongliang(at)gmail(dot)com
CIT Japan:  http://www.cit.co.jp
CIT China:  http://www.citbj.com.cn


Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2009-02-24 09:43:52
Subject: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog
Previous:From: Ashesh VashiDate: 2009-02-24 09:00:24
Subject: Re: PATCH: Update autovacuum (for TOAST-TABLE) to use reloptions, instead of a system catalog

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