오라클에서는 ''(empty string) 과 NULL 은 동일합니다.
하지만 PostgreSQL 에서는 '' 은 절대 NULL 이 아닙니다.
아래 예제를 음미해보세요.
scott@pg-00:5432:scottdb]
SQL> create table test(x varchar(10));
CREATE TABLE
Time: 19.392 ms
scott@pg-00:5432:scottdb]
SQL> insert into test values(100);
INSERT 0 1
Time: 3.773 ms
scott@pg-00:5432:scottdb]
SQL> insert into test values('superman');
INSERT 0 1
Time: 3.114 ms
scott@pg-00:5432:scottdb]
SQL> insert into test values(NULL);
INSERT 0 1
Time: 24.423 ms
scott@pg-00:5432:scottdb]
SQL> insert into test values('');
INSERT 0 1
Time: 2.443 ms
scott@pg-00:5432:scottdb]
SQL> SELECT COUNT(*) FROM TEST where x is null;
count
-------
1
(1 row)
Time: 5.301 ms
SQL> SELECT x FROM TEST where x is not null;
x
----------
100
superman
<-- 눈에 안보이네요.
(3 rows)
Time: 1.022 ms
scott@pg-00:5432:scottdb]
SQL>