I don't know about postgres, but oracle has some quirks about empty strings you need to be aware about if you are planning to support it in your applications:
in Oracle the empty string is ALWAYS considered NULL: if you insert an empty string, you will read back a NULL. In oracle the empty string simply does not exist: it is just "syntax sugar" if you can write '' instead of NULL, when dealing with varchar values.
In Oracle the expression ('' is null)
will evaluate to TRUE. the empty string is DE FACTO null
In oracle any comparison involving a NULL value will ALWAYS evaluate to FALSE. This means that the only operators you can apply to NULL values and that can return TRUE are "is null" and "is not null"
The consequence of the above is that, in oracle, ALL the following expressions will evaluate to FALSE, regardless of the actual value of myvar:
myvar = ''
myvar <> ''
myvar = null
myvar <> null
even these evaluate always to false
null = null
null <> null
null = ''
null <> ''
so the following update will not update anything:
update mytab set myfield ='X' where myfield = ''
as I said, you can only use the 'is null' and 'is not null' operators.
so you must write it as
update mytab set myfield='X' where myfield is null.
P. S. the only oracle function that treats null as a distinct comparable value is Decode(). probably this was born as a bug, but today there is too much software that relies on this behaviour to fix it.
decode( <expression>,
<caseval 1>, < exitval 1>,
<caseval 2>, < exitval 2>,
....
<elseval>)
If replace the "decode" with the equivalent sql standard "case" construct, it won't work: oracle didn't replicate the decode bug when implementing the case syntax